Commit 238e0c24 authored by Philip ABBET's avatar Philip ABBET

Bugfix: hash.hashFileContents() crash for huge files (> free memory size)

parent 8fcb4366
......@@ -112,4 +112,8 @@ def hashFileContents(path):
"""Hashes the file contents using :py:func:`hashlib.sha256`."""
with open(path, 'rb') as f:
return hashlib.sha256(
sha256 = hashlib.sha256()
for chunk in iter(lambda: * 1000), b''):
return sha256.hexdigest()
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment