Hash Functions
Hash function is an important tool for achieving data consistency and quick retrieval.Hash functions help the database to manage and query data efficiently by mapping the input data into a fixed length hash.
digest
Computes the binary hash of an expression using the specified algorithm.
digest(expression, algorithm)
Parameters | Description |
---|---|
expression | String expression to operate on.Can be a constant, column, or function, and any combination of string operators. |
algorithm | String expression specifying algorithm to be used: md5 , sha224 , sha256 , sha384 , sha512 , blake2s , blake2b , blake3 |
View digest
Example
md5
Computes an MD5 128-bit checksum for a string expression.
md5(expression)
Parameters | Description |
---|---|
expression | String expression to operate on.Can be a constant, column, or function, and any combination of string operators. |
View md5
Example
sha224
Computes the SHA-224 hash of a binary string.
sha224(expression)
Parameters | Description |
---|---|
expression | String expression to operate on.Can be a constant, column, or function, and any combination of string operators. |
View sha224
Example
sha256
Computes the SHA-256 hash of a binary string.
sha256(expression)
Parameters | Description |
---|---|
expression | String expression to operate on.Can be a constant, column, or function, and any combination of string operators. |
View sha256
Example
sha384
Computes the SHA-384 hash of a binary string.
sha384(expression)
Parameters | Description |
---|---|
expression | String expression to operate on.Can be a constant, column, or function, and any combination of string operators. |
View sha384
Example
sha512
Computes the SHA-512 hash of a binary string.
sha512(expression)
Parameters | Description |
---|---|
expression | String expression to operate on.Can be a constant, column, or function, and any combination of string operators. |