FNV-1a walks the bytes: xor the byte into the accumulator, then multiply by a fixed prime. The xor-before-multiply order gives good avalanche — flip one input bit and the whole hash changes. Simple enough to write from memory, and it is everywhere (DNS, hash tables, checksums). Here “hi” and “hj” — one byte apart — hash to 3864218 and 3863815.
The demo runs a 24-bit FNV-1a (reduced so the multiply stays exact in i-13’s f64); the full 32-bit form needs a wider integer: live demo
“FNV-1 and FNV-1a are the same.” — FNV-1 multiplies then xors; FNV-1a xors then multiplies, and the a-order avalanches better. cited
Two operations per byte, and it avalanches. arithmetic
On i-13 (24-bit FNV-1a), a one-byte change moves the whole hash: