raise_on_digest_mismatch

raise_on_digest_mismatch(*, path: Path, hexdigests: Mapping[str, str] | None = None, hexdigests_remote: Mapping[str, str] | None = None, hexdigests_strict: bool = False) None[source]

Raise a HexDigestError if the digests do not match.

Parameters:
  • path – The file path.

  • 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

Raises:

HexDigestError – if there are any offending hex digests The expected hexdigests as (algorithm_name, url to file with expected hexdigest) pairs.