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

Method hash_to_end

digest-io/src/reader.rs:121–135  ·  view source on GitHub ↗

Read and hash all bytes remaining in the reader, discarding the data Based on implementation in b2sum crate, MIT License Copyright (c) 2017 John Downey

(&mut self)

Source from the content-addressed store, hash-verified

119 /// Read and hash all bytes remaining in the reader, discarding the data
120 /// Based on implementation in b2sum crate, MIT License Copyright (c) 2017 John Downey
121 pub fn hash_to_end(&mut self) {
122 loop {
123 let count = {
124 let data = self.reader.fill_buf().unwrap();
125 if data.is_empty() {
126 break;
127 }
128
129 self.hasher.update(data);
130 data.len()
131 };
132
133 self.reader.consume(count);
134 }
135 }
136}

Callers

nothing calls this directly

Calls 3

is_emptyMethod · 0.80
lenMethod · 0.80
unwrapMethod · 0.45

Tested by

no test coverage detected