repomatic.hashing module

File digesting, shared by every integrity check.

A stdlib-only leaf, like repomatic.versions: the digest used to live in repomatic.release.binary, so the tool runner and the VirusTotal client each imported the whole ELF and Mach-O parsing stack (pyelftools included) to hash a file.

repomatic.hashing.READ_CHUNK_SIZE = 65536

Read size for incremental hashing and for streaming downloads.

Both walk a file the same way, so they share one buffer: the tool runner hashes what it just downloaded, and a mismatch between the two sizes would only make the second pass re-chunk the first one’s bytes.

repomatic.hashing.compute_file_sha256(path)[source]

Compute the SHA-256 hex digest of a file.

Parameters:

path (Path) – Path to the file.

Return type:

str

Returns:

Lowercase hex digest string.