Fowler–Noll–Vo hash function

From Wikipedia, the free encyclopedia
  (Redirected from Fowler-Noll-Vo hash function)
Jump to: navigation, search

Fowler–Noll–Vo is a non-cryptographic hash function created by Glenn Fowler, Landon Curt Noll, and Phong Vo.

The basis of the FNV hash algorithm was taken from an idea sent as reviewer comments to the IEEE POSIX P1003.2 committee by Glenn Fowler and Phong Vo in 1991. In a subsequent ballot round, Landon Curt Noll improved on their algorithm. Some people tried this hash and found that it worked rather well.[1] In an email message to Landon, they named it the Fowler/Noll/Vo or FNV hash.[2]



The FNV hash algorithms and sample FNV source code have been released into the public domain.[5]

FNV is not a cryptographic hash.

The hash[edit]


FNV-1 hash[edit]

The FNV-1 hash algorithm is as follows:[6]

   hash = FNV_offset_basis
   for each octet_of_data to be hashed
        hash = hash × FNV_prime
        hash = hash XOR octet_of_data
   return hash

In the above pseudocode, all variables are unsigned integers. All variables, except for octet_of_data, have the same number of bits as the FNV hash. The variable, octet_of_data, is an 8 bit unsigned integer.


  • All variables, except for octet_of_data, are 64-bit unsigned integers.
  • The variable, octet_of_data, is an 8 bit unsigned integer.

The values for FNV prime and FNV offset basis may be found in this table.[7]

FNV-1a hash[edit]


   hash = FNV_offset_basis
   for each octet_of_data to be hashed
        hash = hash XOR octet_of_data
        hash = hash × FNV_prime
   return hash

The above pseudocode has the same assumptions that were noted for the FNV-1 pseudocode. The small change in order leads to much better avalanche characteristics.[9]

Non-Cryptographic Hash[edit]

The FNV hash was designed for fast Hash table and Checksum use, not cryptography. The authors have identified the following properties as making the algorithm unsuitable as a cryptographic hash function:[10]

  • Speed of Computation - As a hash designed primarily for hashtable and checksum use, FNV-1 and 1a were designed to be fast to compute. However, this same speed makes finding specific hash values (collisions) by brute force faster.

See also[edit]


External links[edit]