Skip to content
uencoder

FNV

FNV (Fowler-Noll-Vo) is a simple non-cryptographic hash that computes quickly via XOR and multiplication by a prime, used for hash tables and fingerprinting.

Purpose

Provides an extremely low-overhead non-cryptographic hash, suited to hash table key distribution and fast fingerprinting.

Mechanism

FNV-1: hash = (hash × FNV_prime) ⊕ byte; FNV-1a: hash = (hash ⊕ byte) × FNV_prime. The offset basis and prime depend on the word width (e.g. FNV-1a 32-bit uses 2166136261 and 16777619). Non-cryptographic, not collision resistant.

Use cases

  • Hash table key distribution
  • Fast deduplication fingerprints
  • URL routing hashes
  • Non-security checksums

Examples

  • Input
    hello
    Output
    0x4f9f2cab

    FNV-1a 32-bit

Common errors

Using FNV for cryptographic authentication
FNV is not cryptographic; use HMAC-SHA256

Related terms

Related tools

References