Python中的加密
# 明文
import hashlib
msg = '我是明文'
# md5加密
md5 = hashlib.md5(msg.encode('utf-8'))
print(md5.hexdigest())
# sha1加密
sha1 = hashlib.sha1(msg.encode('utf-8'))
print(sha1.hexdigest())
# sha256加密
sha256 = hashlib.sha256(msg.encode('utf-8'))
print(sha256.hexdigest())
------学习贵在分享,贵在记录,贵在总结。