Skip to content

fnv1a_32

fnv1a_32(data, seed?): number

Defined in: hash/fnv_32.ts:19

Computes the 32-bit FNV-1a hash (Fowler–Noll–Vo, XOR-then-multiply order) of data.

Better dispersion than djb2a for short, similar inputs at the same cost. Note that FNV-1a has no finalization step, so its low bits are weaker than those of xxhash32 or murmur3_32 — mask the high bits when bucketing.

Complexity: O(n) in the byte length of data.

Uint8Array

The bytes to hash.

number = OFFSET_BASIS_

The initial state, defaulting to the canonical offset basis.

number

An unsigned 32-bit digest.