关于python2.7的md5加密遇到的问题(TypeError: Unicode-objects must be encoded before hashing)
时间:2018-05-03 09:58:31
收藏:0
阅读:912
https://blog.csdn.net/u012087740/article/details/48439559
import hashlib import sys def md5s(): m=hashlib.md5() strs=sys.argv[1] m.update(strs.encode("utf8")) print(m.hexdigest()) if __name__==‘__main__‘: md5s()
注意update()必须指定要加密的字符串的字符编码
原文:https://www.cnblogs.com/davidwang456/p/8983879.html
评论(0)