Skip to content

security.sha256HmacHex ​

Generate a SHA256 HMAC hash, returned as a hex-encoded string.

js
security.sha256HmacHex(secret, value)

Parameters ​

ParameterTypeDescription
secretstringSecret to hash value.
valuestringValue to hash.

Returns ​

string

Examples ​

js
const hash = security.sha256HmacHex("mySecret", "Hello"); // "c1727e0f30b8af5e4c571ff0d22d0f5decc63018f2d6e376ac16dc04d06e482c"