totpT

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenRandomToken

func GenRandomToken(totp int64) string

GenRandomToken 获取加密密钥

func GenTotpToken

func GenTotpToken(secret string) (string, error)

GenTotpToken 获取数字密钥

func GetTotpToken

func GetTotpToken(secret string) string

GetTotpToken 忽略错误,直接获取token

func HOTP

func HOTP(h func() hash.Hash, key []byte, count uint64, digits int) (string, error)

func TOTP

func TOTP(h func() hash.Hash, secret []byte, t time.Time, interval int, digits int) (string, error)

func VerifyTotpToken

func VerifyTotpToken(secret string, token string) (ok bool)

VerifyTotpToken 验证token

Types

This section is empty.

Jump to

Keyboard shortcuts

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