Categories:

String & binary functions (Checksum)

MD5 , MD5_HEX

Returns a 32-character hex-encoded string containing the 128-bit MD5 message digest.

These functions are synonymous.

See also:

MD5_BINARY, MD5_NUMBER_LOWER64, MD5_NUMBER_UPPER64

Syntax

MD5(<msg>)

MD5_HEX(<msg>)
Copy

Arguments

msg

A string expression, the message to be hashed.

Returns

Returns a 32-character hex-encoded string.

Usage notes

  • Although the MD5* functions were originally developed as cryptographic functions, they are now obsolete for cryptography and should not be used for that purpose. They can be used for other purposes (for example, as “checksum” functions to detect accidental data corruption).

    If you need to encrypt and decrypt data, use the following functions:

Examples

SELECT md5('Snowflake');

----------------------------------+
         MD5('SNOWFLAKE')         |
----------------------------------+
 edf1439075a83a447fb8b630ddc9c8de |
----------------------------------+
Copy