fn verify_hash<R: Read, W: Write>(
    hash_reader: HashReader<R>,
    sink: W,
    expected_hash: &str,
    expected_bytes: u64,
    name: &str,
    params_source: &str,
) -> Result<(), Error>
Expand description

Check if the Blake2b hash from hash_reader matches expected_hash, while streaming from hash_reader into sink.

hash_reader can be used to partially read its inner reader’s data, before verifying the hash using this function.

Returns an error containing name and params_source on failure.