I'm implementing a hash table in pure UnrealScript, which only has support for signed 32-bit integers. This means no 64-bit integers and no unsigned integers. I was in the middle of implementing an FNV hash function, but ran into a potential problem.
The offset_basis for FNV-1 is dependent on n, the size of the hash: 32 bit offset_basis = 2166136261
Well, 2166136261
converts to -2128831035
when the bits are turned into an signed integer representation. My question is whether or not this will negatively affect the hash distribution and result in more collisions.
For quick reference, here is the psuedo-code for the FNV hash:
hash = offset_basis
for each octet_of_data to be hashed
hash = hash * FNV_prime
hash = hash xor octet_of_data
return hash
Thank you for your time.
*
supposed to represent, in the pseudocode, according to the official FNV spec? 32-bit multiplication modulo $2^{32}$? – D.W. Jun 07 '16 at 21:38