srijs / rust-crc32fast

Fast, SIMD-accelerated CRC32 (IEEE) checksum computation in Rust
https://crates.io/crates/crc32fast
Apache License 2.0
269 stars 30 forks source link

Allow providing `amount` when creating Hasher from checksum. #23

Closed calmofthestorm closed 2 years ago

calmofthestorm commented 3 years ago

Given crc(a), crc(b), and len(b), you can compute crc(a || b). The library already supports that via combine, but there is not currently a way to create a Hasher with a non-zero amount and the desired state without access to the original data.

calmofthestorm commented 3 years ago

Thanks for taking a look. I have made the requested changes.

srijs commented 3 years ago

Super, thanks for making the changes! Unfortunately it looks like the build is failing because the benchmarks (which use the internal_new_* constructors are failing to build. Would you be able to fix that up as well? I think the fuzz testing suite is also using them, and might need adjustment too. Thanks!

calmofthestorm commented 3 years ago

Oops, thanks. I fixed the calls in the fuzz tests and the benchmarks.

srijs commented 2 years ago

Released in 1.3.0 🎉