$hmac » History » Revision 2
Revision 1 (Per Amundsen, 04/13/2016 05:11 PM) → Revision 2/3 (Per Amundsen, 12/31/2018 09:11 AM)
_Added in 2.3_
*$hmac(text|&binvar|filename, [key], [hash], [N])*
Returns an HMAC (keyed-Hash Message Authentication Code) based on the supplied key.
_See also [[$hotp]], [[$totp]]._
*Parameters*
text|&binvar|filename - The text or &binvar or filename to calculate.
[key] - The key to hash with. (optional)
[hash] - Hash type: md5, sha1 (default), sha256, sha384, or sha512. (optional)
[N] - The type to calculate N = 0 for plain text (default), 1 for &binvar, 2 for filename. (optional)
*Example*
<pre>
; calculate the sha1 hmac hash for the text 'Hello World' using the key 'test'.
//echo -ag The sha1 hmac for Hello World is $hmac(Hello World, test, sha1)
</pre>