Project

General

Profile

Actions

$hmac » History » Revision 2

« Previous | Revision 2/3 (diff) | Next »
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

; 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)

Updated by Per Amundsen almost 6 years ago · 2 revisions

Also available in: PDF HTML TXT