achanda / ipnetwork

A library to work with CIDRs in rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to create CIDR from network and broadcast?

acim opened this issue · comments

So, 218.188.0.0 and 218.191.255.255 should result into 218.188.0.0/14. I don't see any method in this crate to be able to achieve this. Thank you.

Even worse, sometimes this may result in multiple CIDR's, for example 223.252.177.0 to 223.252.255.255 should result in:

223.252.177.0/24
223.252.178.0/23
223.252.180.0/22
223.252.184.0/21
223.252.192.0/18