Rust implementation of CRC(16, 32, 64)
Add crc
to Cargo.toml
toml
[dependencies]
crc = "2.0"
```rust use crc::{Crc, Algorithm, CRC16IBMSDLC, CRC32_ISCSI};
pub const X25: Crc
asserteq!(X25.checksum(b"123456789"), 0x906e); asserteq!(CASTAGNOLI.checksum(b"123456789"), 0xe3069283);
// use custom algorithm
const CUSTOMALG: Algorithm
cargo bench
with 2.6 GHz Intel Core i7. Comparison
```
crc16 time: [2.0082 ms 2.0206 ms 2.0367 ms]
thrpt: [468.25 MiB/s 471.96 MiB/s 474.89 MiB/s]
crc32 time: [1.7659 ms 1.7793 ms 1.7952 ms] thrpt: [531.25 MiB/s 535.98 MiB/s 540.05 MiB/s]
crc64 time: [2.0655 ms 2.0803 ms 2.0973 ms] thrpt: [454.71 MiB/s 458.43 MiB/s 461.72 MiB/s] ```
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.