Python function to determine if a given IPv4 CIDR fits into another.
How cidr_fit(cidr_a,cidr_b)
works:
- For both CIDR's given:
- Splits each CIDR into address and prefix size parts.
- Converts the address part to a 32 bit binary string.
- Example:
192.168.0.1
becomes11000000101010000000000000000001
.
- Example: