hotp

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package hotp implements HMAC-based one-time passwords as defined in RFC 4226, used for counter-based two-factor authentication codes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(secret []byte, counter uint64, digits int) string

Generate computes an RFC 4226 HOTP value for the given secret and counter, returning a zero-padded decimal string of the requested number of digits.

func Verify

func Verify(secret []byte, counter uint64, code string, digits int) bool

Verify reports whether code matches the HOTP value for the secret and counter.

Types

This section is empty.

Jump to

Keyboard shortcuts

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