SHA224 Function
Overview
The SHA224 function computes the SHA-224 hash value for a given string. SHA-224 is a variant of the SHA-2 family of hash algorithms that can map arbitrary-length data to a fixed-length (224-bit) hash value, outputting a 56-character hexadecimal string.
Syntax
sha224(expr)
Parameters
expr: The input data for which to compute the SHA-224 hash value. Supports STRING, VARCHAR, CHAR, and BINARY types.
Return Result
Returns a STRING type value representing the computed 56-character hexadecimal hash string.
Examples
-
Compute the SHA-224 value of a simple string:
-
Compute the SHA-224 value of a string containing special characters:
-
When the input is NULL:
Notes
- SHA-224 hash values are irreversible, meaning the original data cannot be derived from the hash value.
- SHA-224 outputs a fixed 56-character hexadecimal string (224 bits).
- When the input parameter is NULL, the result is NULL.
- SHA-224 belongs to the SHA-2 family of algorithms, with higher security than SHA-1, suitable for data integrity verification and other scenarios.
