nx_xxhash.nx
buildroot/runtime/nx_xxhash.nx
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
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
structs
| none |
consts
| 30 | const NX_XXH64_P1: i64 = 0x9E3779B185EBCA87 |
| 31 | const NX_XXH64_P2: i64 = 0xC2B2AE3D27D4EB4F |
| 32 | const NX_XXH64_P3: i64 = 0x165667B19E3779F9 |
| 33 | const NX_XXH64_P4: i64 = 0x85EBCA77C2B2AE63 |
| 34 | const NX_XXH64_P5: i64 = 0x27D4EB2F165667C5 |
functions
| 37 | func nx_xxh_rotl(x: i64, k: i64) -> i64 |
| 45 | func nx_xxh_read_u64(p: *u8) -> i64 called by 1: nx_xxh64 |
| 57 | func nx_xxh_read_u32(p: *u8) -> i64 called by 1: nx_xxh64 |
| 64 | func nx_xxh_round(acc: i64, lane: i64) -> i64 |
| 71 | func nx_xxh_merge(acc: i64, lane: i64) -> i64 |
| 80 | func nx_xxh64(data: *u8, n: i64, seed: i64) -> i64 called by 3: mainmainmain calls 5: nx_xxh_roundnx_xxh_read_u64nx_xxh_rotlnx_xxh_mergenx_xxh_read_u32 |
| 156 | func main() -> i64 calls 1: nx_xxh64 |