totp

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: BSD-3-Clause Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotMatch = errors.New("code does not match")
)

Functions

func Compute

func Compute(secret string, value int64) int

Types

type Totp

type Totp struct {
	Secret        string
	Window        int
	Counter       int
	DisallowReuse []int
	ScratchCodes  []int
}

func (*Totp) Authenticate

func (x *Totp) Authenticate(password string) (bool, error)

func (*Totp) CheckCode

func (x *Totp) CheckCode(code int) bool

func (*Totp) CheckScratchCodes

func (x *Totp) CheckScratchCodes(code int) bool

func (*Totp) CheckTotpCode

func (x *Totp) CheckTotpCode(ts, code int) bool

Jump to

Keyboard shortcuts

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