title: FNV 'flavors' and PHP implementation
body: <p>I'm trying to integrate <a href="http://isthe.com/chongo/tech/comp/fnv/" rel="nofollow">FNV</a> hashing algorithm on a PHP-based project as part of a requirement to produce hashes for a variety of data (e.g. URLs, keywords).</p>
  
  <p>I saw this <a href="http://code.google.com/p/boyanov/wiki/FNVHash" rel="nofollow">implementation</a> by Neven Boyanov. He mentioned that due to arithmetic limitations in PHP, he was forced to use bitwise-shifting and  addition instead of multiplication. Is his implementation correct? My knowledge is somehow limited in this area of computer science so I can't verify it myself.</p>
  
  <p>Another question that I have is about the different 'flavors' of FNV. I saw that it offers 32-bit, 64-bit, and 128-bit variants but using the above implemention I always get 8-character hex hashes (I convert the integer result to hex using dechex()). </p>
  
  <p>Given the input "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin at libero mi, quis luctus massa.", I get the following hex results:</p>
  
  <ul>
  <li>(32-bit offset) 5b15c0f2</li>
  <li>(64-bit offset) 6ea33cb5</li>
  </ul>
  
  <p>Why is this so? I'm expecting a 16-character hex result from the 64-bit FNV. Are the 'flavors' referring only to the kind of arithmetic operations and seeds that would be used and not to the length of the result? (i.e. if I say 64-bit FNV, the hashing function would use 64-bit operations and seed but the result would still be 32-bit)</p>
  
  <p>A bit of enlightenment would be greatly appreciated :)</p>