otputil

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package otputils holds generic, table-agnostic OTP helpers: id/code generation and salted-hash create/verify. No DynamoDB or table knowledge lives here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateFlowID

func GenerateFlowID() (string, error)

Opaque URL-safe flow id, e.g. "fl_8xLQ2h7ZK3pR9tVmNq0wYbC1".

func GenerateOTPCode

func GenerateOTPCode() (string, error)

Zero-padded 6-digit CSPRNG code, e.g. "042931".

func HashOTP

func HashOTP(code string) (string, error)

func VerifyOTP

func VerifyOTP(code, storedHash string) bool

Constant-time compare; a malformed stored hash compares false and is treated as a mismatch.

Types

This section is empty.

Jump to

Keyboard shortcuts

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