[Sheepdog] [PATCH 2/5] sheep: add some candy helpers in util.c

Liu Yuan namei.unix at gmail.com
Thu Nov 17 06:41:43 CET 2011


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



More information about the sheepdog mailing list