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
The TEXT that represents the hash value returned by this task. Here, the hash returned is 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
"hello"
The TEXT that represents the source text whose corresponding hash needs to be computed.
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
The TEXT that represents the hash value in binary format returned by this task. Here, the hash returned is 0010110011110010010011011011101001011111101100001010001100001110001001101110100000111011001010101100010110111001111000101001111000011011000101100001111001011100000111111010011101000010010111100111001100000100001100110110001010010011100010111001100000100100
"binary"
The TEXT that represents the format in which the hash will be returned.