Testing different file chunk sizes

This commit is contained in:
Brandon Rising 2024-03-07 15:25:20 -05:00
parent bb3f1b9ca6
commit 3bb50926af

View File

@ -166,7 +166,7 @@ class ModelHash:
"""Hashes a file using a hashlib algorithm."""
hasher = hashlib.new(algorithm)
with open(file_path, "rb") as f:
for chunk in iter(lambda: f.read(128 * 1024), b""):
for chunk in iter(lambda: f.read(8 * 1024), b""):
hasher.update(chunk)
return hasher.hexdigest()