#crc #simd

crc32c

Wrapper for SSE 4.2 CRC32C instructions, with software fallback

6 releases (3 breaking)

0.4.0 Jun 22, 2018
0.3.1 Apr 22, 2018
0.2.0 Nov 11, 2017
0.1.1 Sep 18, 2017

#6 in #crc

Download history 19/week @ 2018-08-22 23/week @ 2018-08-29 29/week @ 2018-09-05 28/week @ 2018-09-12 22/week @ 2018-09-19 15/week @ 2018-09-26 43/week @ 2018-10-03 15/week @ 2018-10-10 93/week @ 2018-10-17 133/week @ 2018-10-24 132/week @ 2018-10-31 704/week @ 2018-11-07 301/week @ 2018-11-14

80 downloads per month
Used in 1 crate

Apache-2.0/MIT

14KB
285 lines

CRC32C

Crates.io Docs.rs Travis

Rust implementation of the CRC-32-Castagnoli algorithm. If you have SSE 4.2 enabled at compile time, it will only build the SSE implementation. Otherwise, it will build both versions, and use cpuid to choose the best implementation at run time.

The code is inspired by Mark Adler's CRC32C implementation.

Usage

First, add this to your Cargo.toml:

[dependencies]
crc32c = "0.4"
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.

No runtime deps

  • build build.rs
  • dev rand 0.4