hotp

package
v0.0.0-...-ef937ea Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCode

func GenerateCode(secret string, counter uint64) (string, error)

GenerateCode creates a HOTP passcode given a counter and secret. This is a shortcut for GenerateCodeCustom, with parameters that are compataible with Google-Authenticator.

func GenerateCodeCustom

func GenerateCodeCustom(secret string, counter uint64, opts hotpConfig.ValidateOpts) (passcode string, err error)

GenerateCodeCustom uses a counter and secret value and options struct to create a passcode.

func Validate

func Validate(passcode string, counter uint64, secret string) bool

Validate a HOTP passcode given a counter and secret. This is a shortcut for ValidateCustom, with parameters that are compataible with Google-Authenticator.

func ValidateCustom

func ValidateCustom(passcode string, counter uint64, secret string, opts hotpConfig.ValidateOpts) (bool, error)

ValidateCustom validates an HOTP with customizable options. Most users should use Validate().

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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