hash/fnv

Guided tour · Hashing · pkg.go.dev →

Fowler–Noll–Vo non-cryptographic hash. Very simple, decent distribution — good for hash tables and bloom filters.

Construct a hasher

32-bit, 64-bit, and 128-bit variants

The 'a' variants (New32a, New64a) scramble better and are the default recommendation.

h := fnv.New64a()
h.Write([]byte("hello"))
fmt.Printf("%016x\n", h.Sum64())