Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Totp ¶
* - Divide the current Unix timestamp by 30 - Encode it as a 64-bit big endian integer - Write the encoded bytes to a SHA-1 HMAC initialized with the TOTP shared key - Let offs = hmac[-1] & 0xF - Let hash = decode hmac[offs .. offs + 4] as a 32-bit big-endian integer - Let code = (hash & 0x7FFFFFFF) % 1000000
Credits: https://drewdevault.com/2022/10/18/TOTP-is-easy.html *
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.