Returns the MD5 hash of a string.
Syntax
string md5(string <str>)Parameters
str: Required. A STRING value. BIGINT, DOUBLE, DECIMAL, and DATETIME values are implicitly converted to STRING before the hash is computed. Passing any other type returns an error.
Return value
A value of the STRING type is returned. Returns null if str is null.
Examples
Example 1: Return the MD5 hash of a string.
-- Returns ddc4c4796880633333d77a60fcda9af6.
select md5('Tech on the net');Example 2: Pass null as the input.
-- Returns null.
select md5(null);Related functions
md5 is a string function. For more information about functions related to string searches and conversion, see String functions.