Skip to main content

twofa

函数名函数描述/介绍
twofa.GetUTCCodeGetUTCCode in twofa lib will receive the secret and return the verify code with utc time
twofa.VerifyUTCCodeVerifyUTCCode in twofa lib will receive the secret and code, then return the verify result
twofa.pocpoc 是一个请求选项,设置 Y-T-Verify-Code 的值为 secret 计算出的 UTC 时间验证码,适配于 poc 包

函数定义#

GetUTCCode#

详细描述#

GetUTCCode in twofa lib will receive the secret and return the verify code with utc time

定义#

GetUTCCode(secret string) string

参数#

参数名参数类型参数解释
secretstring

返回值#

返回值(顺序)返回值类型返回值解释
r1string

VerifyUTCCode#

详细描述#

VerifyUTCCode in twofa lib will receive the secret and code, then return the verify result

定义#

VerifyUTCCode(secret string, code any) bool

参数#

参数名参数类型参数解释
secretstring
codeany

返回值#

返回值(顺序)返回值类型返回值解释
r1bool

poc#

详细描述#

poc 是一个请求选项,设置 Y-T-Verify-Code 的值为 secret 计算出的 UTC 时间验证码,适配于 poc 包

定义#

poc(secret string) poc.PocConfigOption

参数#

参数名参数类型参数解释
secretstring

返回值#

返回值(顺序)返回值类型返回值解释
r1poc.PocConfigOption