rust-lang / flate2-rs

DEFLATE, gzip, and zlib bindings for Rust
https://docs.rs/flate2
Apache License 2.0
917 stars 163 forks source link

Measure crc source using u64 #243

Closed Plecra closed 4 years ago

Plecra commented 4 years ago

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:

joshtriplett commented 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.