Hash Functions

This page covers the various hash functions supported by Rockset.

Note that the functions in this page take bytes arguments and return bytes values. You may pass in a string as argument (it will be encoded as UTF-8), and you may convert the returned bytes to string using, for instance, TO_HEX().

List of functions defined in this section:

FunctionDescription
HASH(x, digest)Computes the hash of the bytes value x using digest, where digest is one of the OpenSSL digest methods md5, sha1, sha256, or sha512 (case insensitive).
HASH_COMBINE(x, ...)Computes a unique hash over all input arguments. Order matters for the input arguments, and all types are supported, though any null argument results in a null return value.
HMAC(x, key, digest)Computes the HMAC of the bytes value x using key as the key and digest as the digest method, where digest is is one of the OpenSSL digest methods md5, sha1, sha256, or sha512 (case insensitive).
HMAC_MD5(x, key)Computes the MD5 HMAC of the bytes value x using key as the key.
HMAC_SHA1(x, key)Computes the SHA1 HMAC of the bytes value x using key as the key.
HMAC_SHA256(x, key)Computes the SHA256 HMAC of the bytes value x using key as the key.
HMAC_SHA512(x, key)Computes the SHA512 HMAC of the bytes value x using key as the key.
ID_HASH(x, ...)Equivalent of TO_BASE64(HASH_COMBINE(args...)). Useful when constructing a custom value for _id in an ingest transformation, e.g. SELECT ID_HASH(field1, field2) AS _id.
MD5(x)Computes the MD5 hash of the bytes value x.
SHA1(x)Computes the SHA1 hash of the bytes value x.
SHA256(x)Computes the SHA256 hash of the bytes value x.
SHA512(x)Computes the SHA512 hash of the bytes value x.
XXH3_64(x[, seed])Computes the 64 bit XXH3 hash of x using seed as the seed. seed is optional, default value is 0.