fn hash<D: Digest + Write>(r: impl Read) -> Result<Output<D>, ErrorKind>
Reads through all data from the passed reader, and returns the resulting Digest. The exact hash function used is left generic over all Digest.