code wiki / (root) / nx_xxhash.nx

nx_xxhash.nx

buildroot/runtime/nx_xxhash.nx

6247 B194 linesdepth 3pulls 3 transitivereach 66 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_xxhash.nx -- xxh64 fast non-crypto hash function. xxHash is the modern recommendation for non-cryptographic hashing: - 5-10 GB/s on modern x86_64 (faster than SipHash, FNV-1a) - Excellent statistical quality (passes SMHasher) - Variable-length input, 64-bit output Used by: - Hash table keys (better collision distribution than FNV-1a) - Bloom filter components - Cache lookup - F6 manifest content addressing (alternative to SHA-256 when cryptographic strength isn't needed) NOT a CSPRNG and NOT a MAC. For security-relevant hashing use SHA-256 or BLAKE3. For DoS-resistant hash tables seed with a random key from nx_random. Reference: https://github.com/Cyan4973/xxHash/blob/dev/doc/xxhash_spec.md

dependencies 1 imports · 4 importers

syscalls.nx nx_xxhash.nx nx_sketch_hll.nx nx_xxhash_kat.nx nx_xxhash_vectors.nx sketch_hll.nx

imports: syscalls.nx

imported by: nx_sketch_hll.nxnx_xxhash_kat.nxnx_xxhash_vectors.nxsketch_hll.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_xxh64 nx_xxh_round nx_xxh_rotl nx_xxh_read_u64 nx_xxh_rotl ↻ nx_xxh_merge nx_xxh_round ↻ nx_xxh_read_u32

structs

none

consts

30const NX_XXH64_P1: i64 = 0x9E3779B185EBCA87
31const NX_XXH64_P2: i64 = 0xC2B2AE3D27D4EB4F
32const NX_XXH64_P3: i64 = 0x165667B19E3779F9
33const NX_XXH64_P4: i64 = 0x85EBCA77C2B2AE63
34const NX_XXH64_P5: i64 = 0x27D4EB2F165667C5

functions

37func nx_xxh_rotl(x: i64, k: i64) -> i64
45func nx_xxh_read_u64(p: *u8) -> i64
called by 1: nx_xxh64
57func nx_xxh_read_u32(p: *u8) -> i64
called by 1: nx_xxh64
64func nx_xxh_round(acc: i64, lane: i64) -> i64
called by 2: nx_xxh_mergenx_xxh64 calls 1: nx_xxh_rotl
71func nx_xxh_merge(acc: i64, lane: i64) -> i64
called by 1: nx_xxh64 calls 1: nx_xxh_round
80func nx_xxh64(data: *u8, n: i64, seed: i64) -> i64
156func main() -> i64
calls 1: nx_xxh64