On 11/17/2011 11:57 AM, MORITA Kazutaka wrote: > If I modified this line to > > return hash & ((1 << bits) - 1); > > the result had become good. It looks like FNV generates values whose > lower bits are more random. > > Anyway, I don't mind introducing a new hash function now. FNV seems > to have some problems if the input buffer length is too short. > > Thanks Hmm, I tried the lower bits, it is surprisingly good, at least for oid hashing. So let's stay with FNV and make the change when needed. I'll submit a updated patch for this hash in candy patch set. Thanks, Yuan |