Computes the SHA-1 hash of a STRING or BINARY expression and returns it as a hexadecimal string.
Syntax
string sha1(string|binary <expr>)Parameters
expr: required. A STRING or BINARY value.
Return value
Returns a STRING value in hexadecimal string format. Returns null if the input is null.
Examples
Example 1: Compute the SHA-1 hash of 'ABC'.
select sha1('ABC');
-- 3c01bdbb26f358bab27f267924aa2c9a03fcfdb8Example 2: Pass null as the input.
select sha1(null);
-- nullRelated functions
For more information, see Other functions.
该文章对您有帮助吗?