Skip to content

Commit 140cb03

Browse files
add comment
1 parent e3032c6 commit 140cb03

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

keras_remote/data/data.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ 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+
# 64 KB: standard buffer size used by shutil.copyfileobj and
27+
# hashlib.file_digest, aligns with NVMe page sizes.
2628
with open(fpath, "rb") as f:
2729
for chunk in iter(partial(f.read, 65536), b""):
2830
h.update(chunk)

0 commit comments

Comments
 (0)