I have a set that contains mixture of ip4 addresses and ip4 networks.
Simple short example:
{'127.0.0.1', '138.56.76.02', '192.4.2.0/24', '29.24.48.80', etc, etc, etc}
Real size is a few thousands items.
Question is – what is the fastest way to check whether specific ip address 'xxx.yyy.zzz.lll'
is contained in all these mixture of ip addresses and ip networks without iterating through them one by one?
With plain ips set it is obvious but with presence of ip networks not so, as network might contain this ip as well.
It is also possible to have same set but with ips and networks inside wrapped in IPv4Address
and IPv4Network
objects from ipaddress
package.
Perhaps it is possible to combine all these in one pseudo-network somehow???
Thanks...