notebook
This commit is contained in:
12
indexer/hasher.py
Normal file
12
indexer/hasher.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from blake3 import blake3
|
||||
|
||||
|
||||
def blake3_file(path, chunk_size=1024 * 1024):
|
||||
"""
|
||||
Spočítá BLAKE3 hash souboru po blocích (bez načtení do paměti)
|
||||
"""
|
||||
h = blake3()
|
||||
with open(path, "rb") as f:
|
||||
for chunk in iter(lambda: f.read(chunk_size), b""):
|
||||
h.update(chunk)
|
||||
return h.digest()
|
||||
Reference in New Issue
Block a user