python MD5 信息摘要

import hashlib
obj_hashlib = hashlib.md5()

data = '今天天气很好'
obj_hashlib.update(data.encode('utf-8'))
print(obj_hashlib.hexdigest())

data2 = '今天天气很好.'
obj_hashlib2 = hashlib.md5()
obj_hashlib2.update(data2.encode('utf-8'))
print(obj_hashlib2.hexdigest())
A:\python\python.exe A:/source/负载格式化脚本/md5_test.py
8f277eff01c48714de37b54a836576f8
57349f60b64525742ad70d9f15841930

Process finished with exit code 0
原文地址:https://www.cnblogs.com/zy09/p/15683674.html