CRC32C implementation with support for CPU-specific acceleration instructions (SSE 4.2) and software fallback.
Usage
To use crc32c-hw
, add this to your Cargo.toml
:
[]
= "^0.1.0"
Example
extern crate crc32c_hw;
let mut crc = 0;
crc = update;
crc = update;
crc = update;
assert_eq!;
assert_eq!;
The easiest way to build binaries with CPU-specific instructions support is via environment variable:
RUSTFLAGS="-C target_cpu=native"
Performance
cargo bench
on MacBook Pro Intel Core i5 2,7 GHz
results in ~23.0 GBps
(hardware) /
~2.5 GBps
(software) throughput.
)
)
)
)
Licence
Distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.
See LICENSE-APACHE, and LICENSE-MIT for details.