Documentation
¶
Index ¶
Constants ¶
View Source
const ( // INTERVAL 时间间隔 INTERVAL = 30 // PIN_MODULO PIN_MODULO = 1000000 // DEFAULT_BASE32_STRING base32的字符串 DEFAULT_BASE32_STRING = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" )
Variables ¶
View Source
var ( // ZerosOnRightModLookup // Integer.numberOfTrailingZeros // http://stackoverflow.com/questions/5471129/number-of-trailing-zeros // http://graphics.stanford.edu/~seander/bithacks.html#ZerosOnRightModLookup ZerosOnRightModLookup = []int{ 32, 0, 1, 26, 2, 23, 27, 0, 3, 16, 24, 30, 28, 11, 0, 13, 4, 7, 17, 0, 25, 22, 31, 15, 29, 10, 12, 6, 0, 21, 14, 9, 5, 20, 8, 19, 18, } )
Functions ¶
func GenerateResponseCode ¶
GenerateResponseCode 生成密码
func GetTotpCode ¶
GetTotpCode 获取totpcode, 这里会生成3个code,当前时间,前30s,后30s 为了预防客户端跟服务端的时间差太大
Types ¶
type Base32Decode ¶
type Base32Decode struct {
// contains filtered or unexported fields
}
Base32Decode base32 解码
func DefaultNewBase32Decode ¶
func DefaultNewBase32Decode() *Base32Decode
DefaultNewBase32Decode 默认base32解码器
func NewBase32Decode ¶
func NewBase32Decode(encode string) *Base32Decode
NewBase32Decode 新建base32解码器
Click to show internal directories.
Click to hide internal directories.