跳到主要内容

authenticator

简介

Google一次性验证码

组件接口

authenticator.gs

函数原型函数作用
string create_secret(int length = 32)生成秘钥
string gen_auth_code(string secret, int offset = 0)根据秘钥和时间计算验证码
bool generate_qrcode_png(string name, string secret, string titles, string path)生成二维码png
void display_url_info(string name, string secret, string titles)打印Google的二维码URL,复制到浏览器可显示二维码
bool verify_auth_code(string secret, string code, int count = 1, int offset = 0)检查验证码