Versions in this module Expand all Collapse all v1 v1.4.0 Aug 26, 2024 Changes in this version + func Generate(opts GenerateOpts) (*otp.Key, error) + func GenerateCode(secret string, t time.Time) (string, error) + func GenerateCodeCustom(secret string, t time.Time, opts ValidateOpts) (passcode string, err error) + func Validate(passcode string, secret string) bool + func ValidateCustom(passcode string, secret string, t time.Time, opts ValidateOpts) (bool, error) + type GenerateOpts struct + AccountName string + Algorithm otp.Algorithm + Digits otp.Digits + Issuer string + Period uint + Rand io.Reader + Secret []byte + SecretSize uint + type ValidateOpts struct + Algorithm otp.Algorithm + Digits otp.Digits + Period uint + Skew uint