No results for ""

Powered byAlgolia

sha256( input, outputEncoding )

Use sha256 to hash an input string.

Parameter Type Description
input string The input string to hash.
outputEncoding string Describes what type of encoding to use for the hash value. Can be "base64" or "hex".


Type Description
string The string-encoded hash digest.


import crypto from 'k6/crypto';

export default function() {
  let hash = crypto.sha256('hello world!', 'hex');

The above script should result in the following being printed during execution:

INFO[0000] 7509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9