Feature Request: Add Subnet-to-Subnet Containment Support
Opening words
You guys are doing an amazing work! thank you guys! :)
Summary
Add support for checking if one subnet is contained within another subnet.
Current vs Requested Behavior
Current:
isInSubnet('10.5.0.1', '10.4.5.0/16'); // IP in subnet
Requested:
isInSubnet('10.5.0.0/24', '10.4.0.0/16'); // true - subnet in subnet
isInSubnet('10.5.0.0/16', '10.4.0.0/24'); // false - larger cannot fit in smaller
isInSubnet('2001:db8:1::/64', '2001:db8::/32'); // true - IPv6 support
Use Cases
- Network planning and IPAM validation
- Security policy verification
- Cloud infrastructure subnet management
This would make the library much more useful for network management tasks.