1
0
의 미러 https://github.com/arsenetar/dupeguru.git synced 2025-09-11 17:58:17 +00:00

[#75 state:fixed] md5 hashes are now computed incrementally.

This commit is contained in:
Virgil Dupras 2010-01-13 08:59:44 +01:00
부모 d62ff40bed
커밋 9f006ec08a

파일 보기

@ -102,8 +102,12 @@ class File(object):
elif field == 'md5':
try:
fp = io.open(self.path, 'rb')
filedata = fp.read()
md5 = hashlib.md5(filedata)
md5 = hashlib.md5()
CHUNK_SIZE = 8192
filedata = fp.read(CHUNK_SIZE)
while filedata:
md5.update(filedata)
filedata = fp.read(CHUNK_SIZE)
self.md5 = md5.digest()
fp.close()
except Exception: