Re: [PATCH] hash: Improve double hashing

2011-11-15 Thread Kristian Høgsberg
On Mon, Nov 14, 2011 at 4:24 AM, Andrea Canciani wrote: > Instead of artificially introducing collisions in the step value by > replacing 0 with 1 (which causes the value 1 to have twice the > frequency of any other value), the step value can simply be computed > as an uniformly distributed value

[PATCH] hash: Improve double hashing

2011-11-14 Thread Andrea Canciani
Instead of artificially introducing collisions in the step value by replacing 0 with 1 (which causes the value 1 to have twice the frequency of any other value), the step value can simply be computed as an uniformly distributed value in the range [1, rehash], extremes included. This is safe becaus