modulepackage
0.0.0-20190416085914-20738c5609f5
Repository: https://github.com/jmolboy/googleauth.git
Documentation: pkg.go.dev
# README
GoogleAuth
google authenticator两步验证golang实现
添加引用
go get github.com/jmolboy/googleauth
使用
获取base32后的秘钥
//strSize:随机的源字符串长度
//RandType:随机源字符串类型:RandTypeAlphaNum=数字&字符 , RandTypeAlpha = 字母 , RandTypeNum=仅数字
secretKey := googleauth.RandSecret(16,googleauth.RandTypeAlphaNum)
秘钥生成二维码
img,_ :=googleauth.QrCode(secretKey,"jmol","jmolboy",200)
秘钥生成base64图片
base64Img,_ :=googleauth.QrBase64(secretKey,"jmol","jmolboy",200)
fmt.Print("base64:"+base64Img)
基于秘钥获取Code
code,_ := googleauth.GetCode(secretKey)
fmt.Println("code:",code)
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author