I want to create a hash value of 32 bit. I have 16 byte source and destination ipv6 addresses and 2 byte source and destination port numbers.
32 bit Output = (Src IP,Dst Ip,Src Port,Dest Port)
It would be better if the hash function distribute the entities well along the 32 bit space. I want to use the result as an index.
Resit
Another, may be useful references:
General Purpose Hash Function Algorithms
CityHash by Google
Note that, it is very hard to make a no collision guaranteed hash function (no different input result in the same hash code). There are many solutions to this problem, most simple one is the open addressing.
Open Addressing
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With