Hi,
I did some tests with some subnets Ip /24 and I will share the results.
I got very good results with this configuration:
Hash table's size:
Let x be the number of ip.
Y = x*2, then
size_table = 'The power of 2 closest to Y, and greater than or equal to Y'.
Hash Function:
return Ip_in_
On (02/06/2012 20:14), enrico d'urso wrote:
>
> Hi,
> I'm looking for an Hash function for Ipv4 addresses.
>
> What are good ones?
Have you tried good general purpose hash functions like murmur3 or
cityhash?
Another option is to use "hash" function that is bijection on integers
and exploit this
In message , enrico d'urso writes:
>
>I'm looking for an Hash function for Ipv4 addresses.
>
>What are good ones?
They are generally very hard to hash well, for all sorts of reasons
related to how we use them.
One way that used to work reasonably well for me:
uint32_t ipv4, h;
3 matches
Mail list logo