GetHOTPCode (open)
Generate an HMAC-based one-time password
Syntax
LOADLIB "wh::util/otp.whlib";
STRING FUNCTION GetHOTPCode(STRING secret, INTEGER64 counter, RECORD options)
Parameters
STRING secret
The key to use (raw byte value)
INTEGER64 counter
The counter value
RECORD options
Options
INTEGER digits
The length of the resulting password, range [6-8], defaults to 6
STRING hmac
The HMAC algorithm to use, defaults to "HMAC:SHA-1"
Return value
STRING
The generated password
Description
This function generates a HMAC-based one-time password. Please note that external applications may not support all of the options and will fallback to the defaults.