我试图编写程序来搜索ffile文件夹中的md5哈希文件以匹配特定的哈希值。请帮忙!
import hashlib
from hashlib import md5
hash_file = raw_input ()
afile = open('ffile','rb')
buf = afile.read ()
答案 0 :(得分:0)
import os
hash_to_find = '5c583fd40360fd039b3ac98387b77dbb'
for i in os.listdir('.'):
if os.path.isfile(i):
with open(i,'rb') as f:
for line in f:
if line.startswith(hash_to_find):
print(i)
break