Python3使用md5 日拱一卒热爱可抵岁月漫长 2019-06-19 1,852 阅读1分钟 业务场景:爬取的文章没有id,将标题进行md5作为id使用 import hashlib print(hashlib.new('md5', b'string').hexdigest()) # 处理中文字符 print(hashlib.md5('加密'.encode(encoding='UTF-8')).hexdigest())