Versions in this module Expand all Collapse all v0 v0.1.0 Sep 10, 2026 Changes in this version + const NoWindow + var ErrUsed = fmt.Errorf("totp: that code has already been used") + var ErrWrongCode = fmt.Errorf("totp: that code is not right") + func At(secret []byte, t time.Time, o Options) (string, error) + func Factor(name string, secret, code []byte, v *Verifier) mfa.Factor + func FormatSecret(secret []byte) string + func Generate(secret []byte, step int64, o Options) (string, error) + func ParseSecret(s string) ([]byte, error) + func URI(issuer, account string, secret []byte, o Options) string + func Verify(secret, code []byte, o Options) error + type Algorithm int + const SHA1 + const SHA256 + const SHA512 + func (a Algorithm) String() string + type Options struct + Algorithm Algorithm + Digits int + Now func() time.Time + Period time.Duration + Window int + func (o Options) Step(t time.Time) int64 + type Verifier struct + Options Options + func (v *Verifier) Forget(name string) + func (v *Verifier) Verify(name string, secret, code []byte) error