otp

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2025 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OTP

type OTP struct {
	// contains filtered or unexported fields
}

func New

func New(options ...Option) (*OTP, error)

func (*OTP) GenerateHOTP

func (o *OTP) GenerateHOTP(secret string, counter uint64) (string, error)

func (*OTP) GenerateTOTP

func (o *OTP) GenerateTOTP(secret string, delta int64) (string, error)

func (*OTP) NewSecret

func (o *OTP) NewSecret(size int) (string, error)

func (*OTP) UrlHOTP

func (o *OTP) UrlHOTP(secret, account, issuer string, counter uint64) string

func (*OTP) UrlTOTP

func (o *OTP) UrlTOTP(secret, account, issuer string) string

type Option

type Option func(o *OTP)

func OptCode6Digits

func OptCode6Digits() Option

func OptCode8Digits

func OptCode8Digits() Option

func OptHashSHA1

func OptHashSHA1() Option

func OptHashSHA256

func OptHashSHA256() Option

func OptHashSHA512

func OptHashSHA512() Option

func OptPeriod

func OptPeriod(v int64) Option

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL