HASH.SHA256
returns the hash calculated from the given string using SHA-256 algorithm. SHA-256 is used to generate a 32 byte (256 bit) hash. This function throws an error if it is passed an argument that is not a string.
Function category: Hash​
HASH.SHA256(arg)
Arguments | Description |
| String. |
Let's say we have the following JSON for which we need to calculate the digest:
{"data": {"foo": 1,"bar": ["x","y"]}}
If we want to transform the context into a string and pass that string to HASH.SHA256
to calculate the digest, use the following function.
# Calculate a digest for specific contentHASH.SHA256(JSON.ENCODE(_))
This will return the following digest:
5ebb5928da91aadae28a855d54d66a74c1ab6fb6d6ebf4f4689f2b310e62a637
Note:
The HASH.MD5
, HASH.SHA1
, HASH.SHA384
, and HASH.SHA512
are supported.