How zeebo/xxh3 works
XXH3 is a Go hashing library that returns 64- or 128-bit digests, with seeded and streaming APIs. Callers provide bytes or strings to a one-shot API, or write chunks to a stateful hasher and request a digest. The one-shot paths specialize by input length; long inputs use scalar or architecture-specific accumulation. The streaming implementation also dispatches accumulation by available CPU features. SIMD assembly-generation sources are shown separately from runtime kernels; their internal wiring was not inspected.
Main entry points: hash64.go 64-bit hash · accum_generic.go Scalar accumulation · hasher.go Streaming hasher · hash64_seed.go Seeded 64-bit
Components 14
Hash APIs
- 64-bit hash
hash64.go - Seeded 64-bit
hash64_seed.go - 128-bit hash
hash128.go - Seeded 128-bit
hash128_seed.go
Streaming Hash
- Streaming hasher
hasher.go - Streaming 128-bit
hasher128.go
Accumulation
- Scalar accumulation
accum_generic.go - SSE kernels
accum_vector_sse_amd64.s - AVX kernels
accum_vector_avx_amd64.s - AVX-512 kernels
accum_vector_avx512_amd64.s - NEON kernels
accum_vector_neon_arm64.s - AVX generator
avo/avx.go
Other components
- Library caller
- Digest value
Connections 21
- Library caller → 64-bit hash: provides input
hash64.go - Library caller → Seeded 64-bit: provides input
hash64_seed.go - Library caller → 128-bit hash: provides input
hash128.go - Library caller → Seeded 128-bit: provides input
hash128_seed.go - Library caller → Streaming hasher: writes chunks
hasher.go - 64-bit hash → Scalar accumulation: accumulates long input
hash64.go - Seeded 64-bit → Scalar accumulation: accumulates long input
hash64_seed.go - 128-bit hash → Scalar accumulation: accumulates long input
hash128.go - Seeded 128-bit → Scalar accumulation: accumulates long input
hash128_seed.go - 64-bit hash → SSE kernels: dispatches SIMD
hash64.go - 64-bit hash → AVX kernels: dispatches SIMD
hash64.go - 64-bit hash → AVX-512 kernels: dispatches SIMD
hash64.go - 64-bit hash → NEON kernels: dispatches SIMD
hash64.go - Streaming hasher → Scalar accumulation: accumulates chunks
hasher.go - Streaming hasher → Streaming 128-bit: supports 128-bit sum
hasher.go - Streaming hasher → Digest value: returns digest
hasher.go - Streaming 128-bit → Digest value: returns digest
- 64-bit hash → Digest value: returns digest
hash64.go - Seeded 64-bit → Digest value: returns digest
hash64_seed.go - 128-bit hash → Digest value: returns digest
hash128.go - Seeded 128-bit → Digest value: returns digest
hash128_seed.go