hotp

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package hotp implements the HMAC-based One-Time Password (HOTP) algorithm. See https://datatracker.ietf.org/doc/html/rfc4226

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HOTP

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

func New

func New(hash func() hash.Hash, digits int) *HOTP

New initialises a new HOTP generator using the supplied hashing function and number of digits.

func (*HOTP) Generate

func (o *HOTP) Generate(secret []byte, count int64) string

Generate generates a HOTP (HMAC-based One-Time Password) code given the shared secret and count.

Jump to

Keyboard shortcuts

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