Computes a hash-based message authentication code over the data with a secret key, returning the result as hex. Use it to verify that a message was produced by someone holding the key.

Parameters

string
required
The data to authenticate.
string
required
The secret key.
string
required
The underlying hash algorithm.

Returns

string
The hex HMAC.

Example

Errors

  • hash: an unkeyed digest.