Skip to main content
Calculates the SHA-224 hash value, SHA-256 hash value, SHA-384 hash value, or SHA-512 hash value of a string.

Syntax

Parameters

  • Expr: the string whose value you want to calculate.
  • hash_length: the length of a hash value. The value of this parameter can be 224, 256, 384, 512, or 0. The value 0 is equivalent to 256. If you set this parameter to any other value, this function returns NULL.

Return value

Returns a hash value of the VARCHAR type. If any of the two input parameters is Null, Null is returned.

Examples

Text

Keywords

SHA2, ENCRYPTION