Fast, SIMD-accelerated CRC32 (IEEE) checksum computation
extern crate crc32fast; use crc32fast::Hasher; let mut hasher = Hasher::new(); hasher.update(b"foo bar baz"); let checksum = hasher.finalize();
This crate contains multiple CRC32 implementations:
- A fast baseline implementation which processes up to 16 bytes per iteration
- An optimized implementation for modern
Hasher::new constructor at runtime will perform a feature detection to select the most
optimal implementation for the current CPU feature set.
|crc32fast (this crate)||1.0.0||baseline||683||1499|
|crc32fast (this crate)||1.0.0||pclmulqdq||140||7314|
Due to the use of SIMD intrinsics for the optimized implementations, this crate contains some amount of
In order to ensure memory safety, the relevant code has been fuzz tested using afl.rs with millions of iterations in both
release build settings. You can inspect the test setup in the
fuzz sub-directory, which also has instructions on how to run the tests yourself.
On top of that, every commit is tested using an address sanitizer in CI to catch any out of bounds memory accesses.
Even though neither fuzzing not sanitization has revealed any safety bugs yet, please don't hesitate to file an issue if you run into any crashes or other unexpected behaviour.
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.