otputil

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ITOTPAuth

type ITOTPAuth interface {
	// GetQRCodeContent 获取二维码内容
	GetQRCodeContent(account, issuer, secret string) string

	// GenSecret 生成密钥
	GenSecret(length int) string

	// GetCode 获取当前验证码
	GetCode(secret string) string

	// GetCodeAt 获取指定时间的验证码
	GetCodeAt(secret string, t time.Time) string

	// Verify 校验当前时间点验证码是否正确
	Verify(secret, code string) bool

	// VerifyAt 校验指定时间二维码是否正确
	VerifyAt(secret, code string, t time.Time) bool
}

func NewGoogleAuth

func NewGoogleAuth() ITOTPAuth

Jump to

Keyboard shortcuts

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