Documentation ¶
Index ¶
Constants ¶
View Source
const ( SHA1 = HashAlgorithm("SHA1") SHA256 = HashAlgorithm("SHA256") SHA512 = HashAlgorithm("SHA512") )
Variables ¶
View Source
var ( ErrInvalidLength = errors.New("invalid length") ErrValidation = errors.New("otp invalid") )
Functions ¶
This section is empty.
Types ¶
type Algorithm ¶
type Algorithm interface { // Generate generates an otp value Generate(reference int64) string // Validate validates the given otp value for the given reference // opts can optionally be used to provide algorithm specific validation options Validate(value string, reference int64, opts ...ValidationOption) (int64, error) // Export exports the configuration of the algorithm Export(exporter Exporter) }
type HashAlgorithm ¶
type HashAlgorithm string
func (HashAlgorithm) Hash ¶
func (h HashAlgorithm) Hash() hash.Hash
func (HashAlgorithm) Size ¶
func (h HashAlgorithm) Size() int
func (HashAlgorithm) String ¶
func (h HashAlgorithm) String() string
type SkewIterator ¶
func NewSkewIterator ¶
func NewSkewIterator(start, end int64) SkewIterator
type ValidationOption ¶
type ValidationOption func(current int64) SkewIterator
Source Files ¶
Click to show internal directories.
Click to hide internal directories.