SHA256 encryption
Table of Contents
Overview
The zoho.encryption.sha256 task returns the hash corresponding to the given text, generated using the SHA256 algorithm.
Syntax
<response> = zoho.encryption.sha256(<data>, <output_type>);
where:
Params | Data type | Description |
<response> | TEXT | The hash generated using the SHA256 algorithm. |
<data> | TEXT | The source text whose corresponding hash needs to be computed. |
<output_type> (Optional) | TEXT | The type in which the generated hash needs to be represented. By default, the output type is hex. Allowed values:
Note: When the <output_type> is specified as binary, the input <data> cannot be more than 1 MB. |
Example 1: Generate hash in hexadecimal format using sha256 algorithm
The following script returns the hash in hexadecimal format generated using the SHA256 algorithm for the text - :
response = zoho.encryption.sha256("hello");
where:
response
"hello"
Example 2: Generate hash in binary format using sha256 algorithm
The following script returns the hash in binary format generated using the SHA256 algorithm for the text - hello:
response = zoho.encryption.sha256("hello", "binary");
where:
response
"binary"