UCE Docs / hmac_sha256

Signature

String hmac_sha256(String key, String data)

Parameters

key : secret key
data : message to authenticate
return value : the raw 32-byte HMAC-SHA256

Computes an HMAC-SHA256 and returns it as raw bytes. Prefer hmac_sha256_hex() for printable signatures; use the raw form for binary protocols.

Example

print(hmac_sha256("key", "message").length(), " raw bytes, hex = ", hmac_sha256_hex("key", "message"), "\n");
Output
32 raw bytes, hex = 6e9ef29b75fffc5b7abae527d58fdadb2fe42e7219011976917343065f58ed4a