Skip to content

sha256

sha256(x): string

Calculate the sha256 hash of the given string input.

Example

sha256('hello world')
// => "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"

Parameters

x

The string to hash.

string | Buffer

Returns

string

The sha256 hash.