Updated on 2024-08-19 GMT+08:00

Hash Functions

Table 1 Hash functions

Hash Function

Description

MD5(string)

Returns the MD5 hash value of the string as a 32-digit hexadecimal string and returns NULL if the string is NULL.

SHA1(string)

Returns the SHA-1 hash value of the string as a 40-digit hexadecimal string and returns NULL if the string is NULL.

SHA224(string)

Returns the SHA-224 hash value of the string as a 56-digit hexadecimal string and returns NULL if the string is NULL.

SHA256(string)

Returns the SHA-256 hash value of the string as a 64-digit hexadecimal string and returns NULL if the string is NULL.

SHA384(string)

Returns the SHA-384 hash value of the string as a 96-digit hexadecimal string and returns NULL if the string is NULL.

SHA512(string)

Returns the SHA-512 hash value of the string as a 128-digit hexadecimal string and returns NULL if the string is NULL.

SHA2(string, hashLength)

Uses the SHA-2 series hash function (SHA-224, SHA-256, SHA-384, or SHA-512) to return the hash value. The first parameter is the string to be hashed, and the second parameter hashLength is the length of the result in bits (224, 256, 384, or 512). Returns NULL if string or hashLength is NULL.