Unicode-objects must be encoded before hashing 错误解决办法

2023-05-16,,

提交注册用户数据后出来这个,错误原因是update()必须指定要加密的字符串的字符编码

#encryption
s1 = sha1()
s1.update(upwd.encode("utf8"))
upwd3 = s1.hexdigest()

Unicode-objects must be encoded before hashing 错误解决办法的相关教程结束。

《Unicode-objects must be encoded before hashing 错误解决办法.doc》

下载本文的Word格式文档,以方便收藏与打印。