A lowercase hexadecimal string with the HMAC-result of the chosen hash if raw is false, or a 1-byte wide MemBuf if true.

Raise

ParamError

in case which is a string and a hash with that name was not found; or if which does not evaluate to a hash object.

AccessError

if which evaluates to a hash object that was already finalized.

Param key can be a String or a MemBuf.

Param which can contain a String with the name of the hash, a hash class constructor, or a function that returns a useable hash object. Unlike the hash() function, it is not possible to pass a hash object directly, because it would have to be used 3 times, which is not possible because of finalization.