Don't ask to ask, just ask | |
PerlMonks |
Storing and searching sets of IP address rangesby acferen (Sexton) |
on Jul 06, 2010 at 21:00 UTC ( [id://848317]=perlquestion: print w/replies, xml ) | Need Help?? |
acferen has asked for the wisdom of the Perl Monks concerning the following question: My goal is to efficiently determine if an IP address is in a set. The simplistic implementation would be a hash of IP addresses, but that can consume way too much memory. If, for example, I put a single Class A (/8 block) in the hash there would need to contain 16,777,214 entries. I considered Set::IntSpan::Fast, Array::IntSpan, and Array::IntSpan::IP, but none of these work for IPv6 addresses. Is there a module I missed that has functionality equivalent to IntSpan that will work with packed IP addresses (v4 and v6)? An alternate approach I haven't considered? Or do I need to get busy writing this module?
Thanks,
Back to
Seekers of Perl Wisdom
|
|