MCPcopy Create free account
hub / github.com/RustCrypto/utils / read

Method read

digest-io/src/reader.rs:89–97  ·  view source on GitHub ↗
(&mut self, buf: &mut [u8])

Source from the content-addressed store, hash-verified

87
88impl<D: Digest, R: io::Read> io::Read for HashReader<D, R> {
89 fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
90 let bytes = self.reader.read(buf)?;
91
92 if bytes > 0 {
93 self.hasher.update(&buf[0..bytes]);
94 }
95
96 Ok(bytes)
97 }
98}
99
100impl<D: Digest + FixedOutputReset, R: io::Read> HashReader<D, R> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected