Declaration
SHA2(str,len)
Description
Computes and returns the SHA-2 hash of a given string, including the SHA-224, SHA-256, SHA-384, and SHA-512 algorithms. str is the plaintext string to be hashed, and len specifies the desired bit length of the result. The value must be 224, 256, 384, 512, or 0 (equivalent to 256).
Examples
obclient [test]> SELECT SHA2('OB',224);
+----------------------------------------------------------+
| SHA2('OB',224) |
+----------------------------------------------------------+
| 00ac28313083c3a30fa0c671f01829ff0fd3253938d0c0225c4c670e |
+----------------------------------------------------------+
1 row in set