Syntax
SHA2(str,len)
Purpose
The SHA2 function calculates and returns the SHA-2 hash of a given string. The function supports the following algorithms: SHA-224, SHA-256, SHA-384, and SHA-512. str specifies the plain text string to be hashed. len specifies the number of bits in the result. Valid values of len are 224, 256, 384, 512, and 0 (which is equivalent to 256).
Examples
obclient [test]> SELECT SHA2('OB',224);
+----------------------------------------------------------+
| SHA2('OB',224) |
+----------------------------------------------------------+
| 00ac28313083c3a30fa0c671f01829ff0fd3253938d0c0225c4c670e |
+----------------------------------------------------------+
1 row in set
