$hmac » History » Version 1
Per Amundsen, 04/13/2016 05:11 PM
1 | 1 | Per Amundsen | _Added in 2.3_ |
---|---|---|---|
2 | |||
3 | *$hmac(text|&binvar|filename, [key], [hash], [N])* |
||
4 | |||
5 | Returns an HMAC (keyed-Hash Message Authentication Code) based on the supplied key. |
||
6 | |||
7 | *Parameters* |
||
8 | |||
9 | text|&binvar|filename - The text or &binvar or filename to calculate. |
||
10 | [key] - The key to hash with. (optional) |
||
11 | [hash] - Hash type: md5, sha1 (default), sha256, sha384, or sha512. (optional) |
||
12 | [N] - The type to calculate N = 0 for plain text (default), 1 for &binvar, 2 for filename. (optional) |
||
13 | |||
14 | *Example* |
||
15 | |||
16 | <pre> |
||
17 | ; calculate the sha1 hmac hash for the text 'Hello World' using the key 'test'. |
||
18 | //echo -ag The sha1 hmac for Hello World is $hmac(Hello World, test, sha1) |
||
19 | </pre> |