xmfa

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTOTPSecret

func GenerateTOTPSecret(length uint8) (string, error)

GenerateTOTPSecret 生成 TOTP 密钥,长度必须为 16(128位) 20(160位) 32(256位)

func GetTOTPToken

func GetTOTPToken(secret string, interval uint8, timestamp int64) (string, error)

GetTOTPToken 生成基于时间的一次性密码 (TOTP)

func IsTOTPSecret

func IsTOTPSecret(secret string) bool

IsTOTPSecret 判断是否为合法的 TOTP 密钥

func ValidateTOTPToken added in v0.1.15

func ValidateTOTPToken(secret string, userCode string, interval uint8, gracePeriod uint8) (bool, error)

ValidateTOTPToken 验证 TOTP Token

Types

This section is empty.

Jump to

Keyboard shortcuts

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