SHA1

All functions > STRING > SHA1

Returns the SHA-1 hash of a string as a 40-character hexadecimal string.

Signatures

Returns: 40-character lowercase hexadecimal SHA-1 hash

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

Notes

  • Returns a 160-bit hash as a 40-character lowercase hex string
  • Deterministic: same input always produces the same hash
  • Not available on DataFusion
  • Not suitable for security-sensitive applications; use SHA256 instead
  • Returns NULL if the input is NULL

Examples

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

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