import hashlib
ch=hashlib.md5()
ch.update(‘hello world‘.encode(‘utf-8‘))
print(ch.hexdigest())
python之hashlib模块
原文:https://www.cnblogs.com/cxydnxs/p/12316107.html