m=hashlib.md5() m.update(‘hello‘.encode(‘utf8‘)) #用md5算法对‘hello‘进行加密 print(m.hexdigest()) #查看密文
s=hashlib.sha3_256() s.update(‘hello‘.encode(‘utf8‘)) print(s.hexdigest())
hashlib模块
原文:https://www.cnblogs.com/Finance-IT-gao/p/10425659.html