MCPcopy
hub / github.com/pex-tool/pex / describe_file

Function describe_file

scripts/create-packages.py:205–213  ·  view source on GitHub ↗
(path: Path)

Source from the content-addressed store, hash-verified

203
204
205def describe_file(path: Path) -> Tuple[str, int]:
206 hasher = hashlib.sha256()
207 size = 0
208 with path.open("rb") as fp:
209 for chunk in iter(lambda: fp.read(io.DEFAULT_BUFFER_SIZE), b""):
210 hasher.update(chunk)
211 size += len(chunk)
212
213 return hasher.hexdigest(), size
214
215
216@dataclass

Callers 1

mainFunction · 0.85

Calls 4

openMethod · 0.80
readMethod · 0.45
updateMethod · 0.45
hexdigestMethod · 0.45

Tested by

no test coverage detected