Closed Plecra closed 4 years ago
The CRC implementation in this crate exists solely to support the formats that use it. (Also, we wouldn't want to decrease its performance at all, which increasing the internal state might lead to.)
This crate doesn't support the zip format, and I don't think that's likely to change; that should be in a separate crate. I'm hopeful that a 64-bit CRC could live in that crate as well, since none of the formats in flate2 would use it.
2^32 is too small to represent the files that are being transferred today, so this API can't practically be used in file integrity checks. Using a u64 is a requirement for any code handling 'real' data sets.
This gets tricky since the API is already stabilised. I think there are two options:
Crc::amount_u64
methodCrc
<N = u32> where Wrapping<N>: Add<Wrapping<N>>
fn Crc::amount(&self) -> N