SHA2_HEX

functionsupportedCore SQL functions

docs.snowflake.com ↗

String & binary functions

Returns a hex-encoded string containing the N-bit SHA-2 message digest, where N is the specified output digest size. These functions are synonymous.

Syntax

supportedpartialnot supportednot scored

SHA2( <msg> [, <digest_size>] )

SHA2_HEX( <msg> [, <digest_size>] )

Parameters

NameRequiredDescription
msgrequiredA string expression, the message to be hashed
digest_sizeoptionalSize (in bits) of the output, corresponding to the specific SHA-2 function used to encrypt the string: 224 = SHA-224 256 = SHA-256 (Default) 384 = SHA-384 512 = SHA-512 SHA-512/224 and SHA-512/256 are not supported.

Returns

The data type of the returned value is VARCHAR.

Usage notes