SHA or MD5 Hash
Function calculating a SHA or MD5 digest hash
Evaluation
This expression evaluates to a function of the form:
(x) -> any
The function calculates the digest of argument x
using the selected algorithm and returns it as a binary value or a hex string.
Processing
The returned function calculates the digest of argument x
as follows:
- If
x
isnil
,nil
is returned. - If
x
is of typebinary
the digest of its bytes is returned. - If
x
is of typestring
the digest of the UTF-8 bytes of the string is returned. - If
x
is of a type that can be cast to string - such as numeric types - it is cast to string and the digest of the UTF-8 bytes of the string is returned. - If
x
cannot be cast to string, an error is thrown.
Settings
Name | Type | Description |
---|---|---|
Algorithm |
string |
The following algorithms are supported:
|
Result Format |
string |
The hashing function can return the hash digest in the following forms:
|