Versions in this module Expand all Collapse all v0 v0.2.0 Oct 10, 2020 v0.1.0 Aug 18, 2020 Changes in this version + const DefaultLength + const DefaultSecretLength + const DefaultStep + const MaxLength + const MinLength + const MinSecretLength + var ErrMaxLength = fmt.Errorf("a %d-digit code is the maximum length", MaxLength) + var ErrMinLength = fmt.Errorf("a %d-digit code is the minimum length", MinLength) + var ErrSecretLength = fmt.Errorf("the Secret's length must be at least %d bits", MinSecretLength) + func GenerateTokenHOTP(h *HOTP) (string, error) + func GenerateTokenTOTP(t *TOTP) (string, error) + func ValidateTokenHOTP(probable string, h *HOTP) (bool, error) + func ValidateTokenTOTP(probable string, t *TOTP) (bool, error) + type Algorithm int + const AlgorithmSHA1 + const AlgorithmSHA256 + const AlgorithmSHA512 + func (a Algorithm) New() hash.Hash + type HOTP struct + Algorithm Algorithm + Counter uint64 + Digits int + Secret string + type TOTP struct + Algorithm Algorithm + Digits int + Period uint + Secret string + UnixTime uint64