DB2 Scalar functions - HASH
The HASH function returns a 128-bit, 160-bit, 256-bit or 512-bit hash of the input data, depending on the algorithm selected, and is intended for cryptographic purposes.
The schema is SYSIBM.
Table 1. Resulting size from each algorithm
Note that security flaws have been identified in both the SHA1 and MD5 algorithms. You can find acceptable hash algorithms in applicable compliance documentation, such as National Institute of Standards and Technology (NIST) Special Publication 800-131A.
The data type of the result is VARBINARY. If any argument can be null, the result can be null. If any argument is null, the result is the null value.
values hash('Charlie at IBM', 1) result is Ãä#F$Âüin¬SðÂÂ¥G5§