Versions in this module Expand all Collapse all v0 v0.0.1 Dec 30, 2023 Changes in this version + const DefaultAlgorithm + const DefaultDigits + const DefaultPeriod + var ErrDecodingBase32Secret = errors.New("error decoding base32 secret") + var ErrTooManyDigits = errors.New("too many digits") + var ErrUnknownHashAlgorithm = errors.New("unknown hash algorithm") + type Algorithm string + const SHA1 + const SHA256 + const SHA512 + type Options struct + Algorithm Algorithm + Digits uint + Period uint + type TOTP struct + ALgorithm Algorithm + Digits uint + HashFunc func() hash.Hash + Period uint + Secret []byte + func New(secret string, options *Options) (*TOTP, error) + func (t *TOTP) Generate() string + func (t *TOTP) GenerateAt(timestamp time.Time) string + func (t *TOTP) Verify(code string) bool + func (t *TOTP) VerifyAt(code string, timestamp time.Time) bool