lz4r 1.10.0

LZ4 CLI programs — Rust port of lz4-1.10.0/programs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Thin wrapper around the `xxhash-rust` crate providing the XXH32 API used
//! by the rest of this crate (mirrors `xxhash.c` / `xxhash.h` from LZ4 v1.10.0).
//!
//! Only XXH32 is needed: `lz4frame` uses it exclusively for content checksums.

pub use xxhash_rust::xxh32::Xxh32 as Xxh32State;

/// One-shot XXH32 hash — equivalent to the C `XXH32(data, len, seed)` function.
///
/// # Test vectors
/// * `xxh32_oneshot(b"", 0)` == `0x02CC5D05`
#[inline]
pub fn xxh32_oneshot(data: &[u8], seed: u32) -> u32 {
    xxhash_rust::xxh32::xxh32(data, seed)
}