On 2011-11-23 04:24, Arvind wrote:

[...] I want to convert an IP address of the form A.B.C.D into a
number that will serve as an index of the array.  I want to do it in a
way that there is very low probability of the number created from
A.B.C.D being the same as that created from E.F.G.H.

Try a Bloom filter.


If that is too clashy, just use a multilevel hash:

  $ip{ chr(127) }{ chr(0) }{ chr(0) }{ chr(1) } = 1;

--
Ruud

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to