Atom

crypto.hmac()

Computes an HMAC.

Signature

crypto.hmac(algorithm, key, data)

Parameters

Algorithm sha256 or sha512, key and data, both text/packed.

Returns

Packed digest bytes.

Behavior

Uses the selected hash and key.

Errors

Unsupported algorithm or backend failure.

Example

Atom
use crypto
assert(count(crypto.hmac('sha256', 'key', 'Atom')) == 32)