谷歌身份验证码是继续时间计算的。服务端和客户端各自根据密钥,基于时间为30秒为验证码,网上搜了很多,一直报错,还是看我同事何泽
解决报错TypeError: Incorrect padding 的问题,因为秘钥不是8的倍数,需要用“=”补足,不知道为啥网上资料这么难搜索
import hmac, base64, struct, hashlib, time def calGoogleCode(secretKey): input = int(time.time())//30 lens = len(secretKey) lenx = 8 - (lens % 4 if lens %

3033

被折叠的 条评论
为什么被折叠?



