Syntax
SHA2(str,len)
Purpose
SHA2 calculates and returns the SHA-2 digest for a given string. The SHA-224, SHA-256, SHA-384, and SHA-512 algorithms are supported. str indicates the plaintext string to be hashed. len indicates the required bit length of the result, which 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