2020
12-02
12-02
Python用摘要算法生成token及检验token的示例代码
#基础版,不依赖环境importtimeimportbase64importhashlibclassToken_hander():def__init__(self,out_time):self.out_time=out_timeself.time=self.timerpassdeftimer(self):returntime.time()defhax(self,str):"""摘要算法加密:paramstr:待加密字符串:return:加密后的字符串"""ifnotisinstance(str,bytes):#如果传入不是bytes类型,则转为bytes类型try:...
继续阅读 >