“哈希校验和”对象支持所需的缓冲区API

2024-10-04 11:22:34 发布

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

我试图计算pycharm中“Disk image”USbImg.E01的散列值

import hashlib

try:
    file = open("F:/USB Try MATCH/USBTRY.E01",'r')
except:
    print("\nFile not found")
ad5 = hashlib.md5()
ad5.update(file)
print("md5: %s" % ad5.hexdigest())

object supporting the buffer API required


Tags: imageimportopenmd5pycharmfileusbhashlib
1条回答
网友
1楼 · 发布于 2024-10-04 11:22:34

导入hashlib 字段名='F:/NEWIMG2/ABC.E01' hashermd5=hashlib.md5() 以open(fiename,'rb')作为open\u文件: content=open\u file.read() hashermd5.update(内容) 打印(“md5:%s”%hashermd5.hexdigest())

相关问题 更多 >