get_offending_hexdigests

get_offending_hexdigests(path: str | Path, chunk_size: int | None = None, hexdigests: Mapping[str, str] | None = None, hexdigests_remote: Mapping[str, str] | None = None, hexdigests_strict: bool = False) Collection[HexDigestMismatch][source]

Check a file for hash sums.

Parameters:
  • path – The file path.

  • chunk_size – The chunk size for reading the file.

  • hexdigests – The expected hexdigests as (algorithm_name, expected_hex_digest) pairs.

  • hexdigests_remote – The expected hexdigests as (algorithm_name, url to file with expected hexdigest) pairs.

  • hexdigests_strict – Set this to false to stop automatically checking for the algorithm(filename)=hash format

Returns:

A collection of observed / expected hexdigests where the digests do not match.