Skip to main content

Categories: Cryptography

SHA256

Returns the SHA-256 hash of the input as a 64-character hexadecimal string.

Syntax​

SHA256(expression any) → varchar​

  • expression: Value to hash. Accepts any type.

Examples

SHA256 example
SELECT SHA256('Dremio')
-- ffae26c65c486a4d9143cbb1a6829166f17dab711910fdfc5787b1a249bd9921
Compute the SHA-256 hash of a string
SELECT SHA256('hello')
-- 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
Compute the SHA-256 hash of a NULL value
SELECT SHA256(NULL)
-- null