crc32c

Crates.iocrc32c
lib.rscrc32c
version0.6.8
sourcesrc
created_at2017-09-15 15:21:20.021596
updated_at2024-06-09 17:15:44.323361
descriptionSafe implementation for hardware accelerated CRC32C instructions with software fallback
homepagehttps://github.com/zowens/crc32c
repositoryhttps://github.com/zowens/crc32c
max_upload_size
id31892
size30,901
Zack Owens (zowens)

documentation

http://docs.rs/crc32c

README

CRC32C

Crates.io Docs.rs Travis

Rust implementation of the CRC-32-Castagnoli algorithm with hardware acceleration where possible.

Hardware acceleration on the following architectures:

  1. x84-64 with SSE 4.2
    • All stable versions of Rust
    • If SSE 4.2 is enabled at compile time, it will only build the SSE implementation. Otherwise, the cpuid is used to find the best implementation at runtime.
  2. aarch64 with crc feature
    • Only available on rust version >= 1.80.0 or nightly

All other processors utilize a software fallback.

Usage

First, add this to your Cargo.toml:

[dependencies]
crc32c = "0.6"
extern crate crc32c;

fn main() {
    let message = b"Hello world!";
    let crc = crc32c::crc32c(message);

    println!("hash = {}", crc);
}

License

You may use this code under either the Apache 2.0 license or the MIT license, at your option.

Commit count: 93

cargo fmt