Recipes
Data & Functions
Calculate a SHA256 hash

Calculate a SHA256 hash

Problem

You want to generate a SHA 256 hash of a value for use in your application.

Solution

Use the built-in $crypto.sha256() function to receive a string of the SHA 256 hash.

For example in a TypeScript Client function:

Code example

const myHash = $crypto.sha256("dynaboard")
return myHash // => 0d52901032dbf3b9a726d1784600541141a513604f0bb083268f2929ca6b5100

Discussion

See also