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)
| 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 | } |