parquet2 0.17.2

Safe implementation of parquet IO.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use xxhash_rust::xxh64::xxh64;

use crate::types::NativeType;

const SEED: u64 = 0;

/// (xxh64) hash of a [`NativeType`].
#[inline]
pub fn hash_native<T: NativeType>(value: T) -> u64 {
    xxh64(value.to_le_bytes().as_ref(), SEED)
}

/// (xxh64) hash of a sequence of bytes (e.g. ByteArray).
#[inline]
pub fn hash_byte<A: AsRef<[u8]>>(value: A) -> u64 {
    xxh64(value.as_ref(), SEED)
}