get_offending_hexdigests

get_offending_hexdigests(path, chunk_size=None, hexdigests=None, hexdigests_remote=None, hexdigests_strict=False)[source]

Check a file for hash sums.

Parameters:
  • path (Union[str, Path]) – The file path.

  • chunk_size (Optional[int]) – The chunk size for reading the file.

  • hexdigests (Optional[Mapping[str, str]]) – The expected hexdigests as (algorithm_name, expected_hex_digest) pairs.

  • hexdigests_remote (Optional[Mapping[str, str]]) – The expected hexdigests as (algorithm_name, url to file with expected hexdigest) pairs.

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

Return type:

Collection[HexDigestMismatch]

Returns:

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