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,
-Andrew
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Storing and searching sets of IP address ranges
by ikegami (Patriarch) on Jul 06, 2010 at 21:56 UTC | |
by ikegami (Patriarch) on Jul 06, 2010 at 22:52 UTC | |
by acferen (Sexton) on Jul 07, 2010 at 12:47 UTC | |
by ikegami (Patriarch) on Jul 07, 2010 at 15:47 UTC | |
Re: Storing and searching sets of IP address ranges
by hexcoder (Curate) on Jul 06, 2010 at 22:21 UTC | |
Re: Storing and searching sets of IP address ranges
by FloydATC (Deacon) on Jul 07, 2010 at 06:07 UTC | |
by acferen (Sexton) on Jul 07, 2010 at 12:24 UTC | |
Re: Storing and searching sets of IP address ranges
by DrHyde (Prior) on Jul 08, 2010 at 10:24 UTC |
Back to
Seekers of Perl Wisdom