Implementation of FNV hash in PHP

FNV is a simple algorithm and produces good results.

I needed this functionality as part of another project that required automated generation of relatively large number of unique usernames based on information provided by the user.

Some challenges:  Apparently PHP does not work well with numbers, especially large ones. I spent few hours trying to find out why my implementation was not producing correct results, … realized in the end that arithmetic with big numbers is something you should not do with PHP. To resolve these issues I had to use bitwise shift and add operations instead of multiply.

I put the code here: http://code.google.com/p/boyanov/source/browse/?repo=prototypes#hg/fnvhash.

… and a simple wiki page here: http://code.google.com/p/boyanov/wiki/FNVHash.

More information about the Fowler-Noll-Vo hash function could be found here: