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.

Syntax

MD5(<msg>)

MD5_HEX(<msg>)

Arguments

msg
A string expression, the message to be hashed.

Returns

Returns a 32-character hex-encoded string.

Usage Notes

Although the MD5, MD5_BINARY, and MD5_NUMBER 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.

Examples

SELECT md5('Snowflake');

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