sw

package
v0.0.0-...-50fbe42 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OATH

type OATH struct {
	Hash   func() hash.Hash
	Period time.Duration
	// contains filtered or unexported fields
}

func New

func New(key []byte, hash func() hash.Hash, period time.Duration) (*OATH, error)

func (*OATH) CalculateHOTP

func (o *OATH) CalculateHOTP(counter uint64) []byte

func (*OATH) CalculateTOTP

func (o *OATH) CalculateTOTP(t time.Time) []byte

func (*OATH) ValidateHOTP

func (o *OATH) ValidateHOTP(counter uint64, hash []byte) bool

func (*OATH) ValidateTOTP

func (o *OATH) ValidateTOTP(t time.Time, hash []byte) bool

Jump to

Keyboard shortcuts

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