SHA256(text) Last updated: 13. Nov 2023

A utility function that takes a single input, converts it to a string, processes it through the SHA256 hashing algorithm, and returns the hash value as an uppercase hexadecimal string. If provided with incorrect arguments, it returns null.

Parameters

Name Type Description
text string Text to create hash for.

Returns

Uppercase hexadecimal string. If provided with incorrect arguments, it returns null.

Example

Code example (#JS)

#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.
#{
    let x = "test";
    write(docly.SHA256(x));
}#

Output

The #JS code above produces the output shown below:
9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08