Skip to content

Commit 97b3eb5

Browse files
add comments
1 parent e3032c6 commit 97b3eb5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

keras_remote/data/data.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ def _hash_single_file(fpath: str, relpath: str) -> bytes:
2323
h = hashlib.sha256()
2424
h.update(relpath.encode("utf-8"))
2525
h.update(b"\0")
26+
# 256 KB: matches hashlib.file_digest's default buffer size.
2627
with open(fpath, "rb") as f:
27-
for chunk in iter(partial(f.read, 65536), b""):
28+
for chunk in iter(partial(f.read, 2**18), b""):
2829
h.update(chunk)
2930
return h.digest()
3031

0 commit comments

Comments
 (0)