On Fri, 7 Jan 2000, Bhaskara P wrote:

> Can suggest some good hashing function to hash 32 bit ipv4 address
> into an hashing table of size between 256 and 1024.

Your keys range 0..2^32-1, and your hash table is (say) 253 - highest
(hopefully) prime number less than 256:

hash = key % 253

You'll have to handle collisions, of course, but presumably you know how
many entries you'll want to store at any particular time.

--
 Kendall Lister, Systems Operator for Charon I.S. - [EMAIL PROTECTED]
  Charon Information Services - Friendly, Cheap Melbourne ISP: 9589 7781

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to