The hash-algorithm is a character string value that specifies the algorithm to generate the digest. This can be the RSA Message Digest Hash Algorithm ("MD5"), the United States Government Secure Hash Algorithm ("SHA-1"), the United States Government Secure Hash Algorithm ("SHA-256"), or the United States Government Secure Hash Algorithm ("SHA-512").
Both the data-to-digest and secret-key-bytes values accept CHARACTER, LONGCHAR, MEMPTR, or RAW values. If you use a CHARACTER or LONGCHAR, the function automatically converts the value to the UTF-8 code page before generating the digest, ensuring that the digest is code-page independent.
The result of each hash algorithm is a RAW digest value that is 16 bytes long for an MD5 message digest, 20 bytes long for an SHA-1 message digest, 32 bytes long for a SHA-256 message digest, and 64 bytes long for a SHA-512 message digest.