Rust improved implementation of the Slice-by-8 intel algorithm.
Slice-by-8 do not load the standard library (a.k.a #![no_std]
)
Slice-by-8 provides hash function that performs CRC32c hashing using improved variant of intel's Slice-by-8 algorithm.
Slice-by-8 is tested on little-endian but should work on big-endian architecture.
```rust use sliceby8::SliceBy8BuildHasher; use std::collections::HashMap; const KEY: &str = "hash"; const VALUE: &str = "me!";
// Create a HashMap that use SliceBy8Hasher to hash keys let mut map = HashMap::with_hasher(SliceBy8BuildHasher::default()); map.insert(KEY, VALUE);
assert_eq!(map.get(&KEY), Some(&VALUE)); ```
Slice-by-8 provides functions to hash slice of bytes.
rust ignore
fn slice_by_8(buf: &[u8]) -> u32;
fn slice_by_8_with_seed(buf: &[u8], seed: u32) -> u32;
Noteslice_by_8
is a similar to slice_by_8_with_seed
with seed
equals 0
.
This implementation is an improvement of the intel algorithm. Improvement are based on : * Stephan Brumme Fast CRC32 * Redis CRC Speed Improvements * Unreal Engine 4