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 secretThe key to use (raw byte value)
INTEGER64 counterThe counter value
RECORD optionsOptions
INTEGER digitsThe length of the resulting password, range [6-8], defaults to 6
STRING hmacThe HMAC algorithm to use, defaults to "HMAC:SHA-1"
Return value
STRINGThe 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.