跳到主要内容

SHA1

Calculates an SHA-1 160-bit checksum for the string, as described in RFC 3174 (Secure Hash Algorithm). The value is returned as a string of 40 hexadecimal digits or NULL if the argument was NULL.

Syntax

sha(expression)
sha1(expression)

Arguments

ArgumentsDescription
expressionThe string value.

Return Type

A String data type.

Examples

SELECT sha('1234567890');
+------------------------------------------+
| sha1('1234567890') |
+------------------------------------------+
| 01b307acba4f54f55aafc33bb06bbbf6ca803e9a |
+------------------------------------------+

SELECT sha1('1234567890');
+------------------------------------------+
| sha1('1234567890') |
+------------------------------------------+
| 01b307acba4f54f55aafc33bb06bbbf6ca803e9a |
+------------------------------------------+