totp

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: 4 Imported by: 0

Documentation

Overview

Package totp implements the Time-based One-Time Password (TOTP) algorithm. See https://datatracker.ietf.org/doc/html/rfc6238

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TOTP

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

func New

func New(hash func() hash.Hash, digits int, period int) *TOTP

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

func (*TOTP) Generate

func (o *TOTP) Generate(secret []byte, when time.Time) (string, error)

Generate generates a TOTP (Time-based One-Time Password) code given the shared secret and a time.

Jump to

Keyboard shortcuts

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