Skip to content

Function: fnvHash()

fnvHash(…values): string

Short, deterministic FNV-1a hash over one or more values. Wraps fnvHashWithOptions with all defaults: 6-char Crockford-style base-32 output (digits + lowercase, minus i/l/o/u). Browser-safe (no node:crypto).

Accepts any mix of primitives, arrays, plain objects, Maps, and Sets; nested structures are walked deterministically so the hash is order-stable for objects / maps / sets and order-sensitive for arrays. Cycles are detected and folded into a circular: marker.

Use for cache keys, slug suffixes, log correlation ids, and other “give me something short and stable” needs - never for tokens or signatures. FNV-1a is a non-cryptographic hash.

unknown[]

string

fnvHash("databricks-claude-sonnet-4-6"); // "k3p9q7"
fnvHash([1, 2, 3]) !== fnvHash([3, 2, 1]);