SHA256

All functions > STRING > SHA256

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

Signatures

Returns: 64-character lowercase hexadecimal SHA-256 hash

SHA256(string: VARCHAR) → VARCHAR
sql
ParameterTypeRequiredDescription
stringVARCHARYesString to hash

Notes

  • Returns a 256-bit hash as a 64-character lowercase hex string
  • Deterministic: same input always produces the same hash
  • Suitable for integrity checks and non-reversible identifiers
  • Returns NULL if the input is NULL

Examples

FeatureQL
SELECT
    f1 := SHA256('ABC'),  -- Hash of uppercase string
    f2 := SHA256('hello'),  -- Hash of lowercase string
    f3 := SHA256('')  -- Hash of empty string
;
Result
f1 VARCHARf2 VARCHARf3 VARCHAR
b5d4045c3f466fa91fe2cc6abe79232a1a57cdf104f7a26e716e0a1e2789df782cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19