Documentation ¶
Index ¶
Constants ¶
View Source
const ( RETURN_DIGITS int = 6 SECRET_LENGTH int = 16 )
Variables ¶
This section is empty.
Functions ¶
func GenerateSecret ¶
Generates a cryptographically secure base32 string that is the proper length for a secret to be used with Google Authenticator. This can be used for generating new secrets.
func GetOTP ¶
Returns a string containing the TOTP token associated with the provided secret at the current time. The secret should be base32 encoded.
func ValidateOTP ¶
Returns a boolean indicating if the provided otp string is valid for the provided secret at the current time. The secret should be base32 encoded.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.