在python 3.x中更改图像文件的md5签名

2024-04-28 16:52:55 发布

您现在位置:Python中文网/ 问答频道 /正文

所以我想写一个小python脚本来更改图像的md5签名

hasher = hashlib.md5()
with open('Images\Test.jpg', 'rb') as afile:
    buf = afile.read()
    print("test")
    hasher.update(buf)
print(hasher.hexdigest())

这将得到照片md5,但我需要一个方法来改变它,有什么想法


Tags: test图像脚本aswithopenmd5hashlib