| |
- hotp(key, counter, nrDigits=6, hmacHash='SHA1')
- HOTP - An HMAC-Based One-Time Password Algorithm.
key: The HOTP key. Either raw bytes or a base32 encoded string.
counter: The HOTP counter integer.
nrDigits: The number of digits to return. Can be 1 to 8.
hmacHash: The name string of the hashing algorithm.
Returns the calculated HOTP token string.
- totp(key, nrDigits=6, hmacHash='SHA1', t=None)
- TOTP - Time-Based One-Time Password Algorithm.
nrDigits: The number of digits to return. Can be 1 to 8.
hmacHash: The name string of the hashing algorithm.
t: Optional; the time in seconds. Uses time.time(), if not given.
Returns the calculated TOTP token string.
|