Documentation ¶
Index ¶
Constants ¶
View Source
const ( OtpTypeTotp = "totp" OtpTypeHotp = "hotp" )
Variables ¶
This section is empty.
Functions ¶
func BuildUri ¶
func BuildUri(otpType, secret, accountName, issuerName, algorithm string, initialCount, digits, period int) string
生成OTP验证的URI(适用与TOTP和HOTP) https://github.com/google/google-authenticator/wiki/Key-Uri-Format * 参数说明:
otpType: otp类型,必须是totp/hotp secret: 用于生成URI的hotp/totp secret accountName: 账号名 issuerName: OTP发行人名称,这是OTP的组织标题 algorithm: 算法名称 initialCount: 计数器开始值,只用于hotp digits: OTP Code生成的长度 period: OTP Code的过期时间(秒)
返回值:
用于OTP验证的URI
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.