MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / _hash_buf

Function _hash_buf

docling/utils/utils.py:25–29  ·  view source on GitHub ↗
(binary_stream)

Source from the content-addressed store, hash-verified

23 hasher = hashlib.sha256()
24
25 def _hash_buf(binary_stream):
26 buf = binary_stream.read(block_size) # read and page_hash in chunks
27 while len(buf) > 0:
28 hasher.update(buf)
29 buf = binary_stream.read(block_size)
30
31 if isinstance(path_or_stream, Path):
32 with path_or_stream.open("rb") as afile:

Callers 1

create_file_hashFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected