Versions in this module Expand all Collapse all v1 v1.0.0 May 12, 2022 Changes in this version + const OtpTypeHotp + const OtpTypeTotp + func BuildUri(otpType, secret, accountName, issuerName, algorithm string, ...) string + func Itob(integer int) []byte + func RandomSecret(length int) string + type HOTP struct + func NewDefaultHOTP(secret string) *HOTP + func NewHOTP(secret string, digits int, hasher *Hasher) *HOTP + func (h *HOTP) At(count int) string + func (h *HOTP) ProvisioningUri(accountName, issuerName string, initialCount int) string + func (h *HOTP) Verify(otp string, count int) bool + type Hasher struct + Digest func() hash.Hash + HashName string + type OTP struct + func NewOTP(secret string, digits int, hasher *Hasher) OTP + type TOTP struct + func NewDefaultTOTP(secret string) *TOTP + func NewTOTP(secret string, digits, interval int, hasher *Hasher) *TOTP + func (t *TOTP) At(timestamp int) string + func (t *TOTP) Now() string + func (t *TOTP) NowWithExpiration() (string, int64) + func (t *TOTP) ProvisioningUri(accountName, issuerName string) string + func (t *TOTP) Verify(otp string, timestamp int) bool