cidr-tools icon indicating copy to clipboard operation
cidr-tools copied to clipboard

Feature Request : Split CIDR into evenvly sized chuncks

Open poirazis opened this issue 1 year ago • 1 comments

It would be a nice feature to be able to have a split function that would return an array of the CIDR chunks. It would be similar to expandCidr , but instead of expanding to individual IPs will expand to ranges

for example

splitCidr ("2001:db8::/32", "/37") would return an array of the /37 networks

poirazis avatar Feb 25 '24 17:02 poirazis

Sounds useful, but no personal interest from me in implementing it. The API should have two return values: {splits: [...networks], remainders: [...networks]}. Also what may be useful is to also allow split to n networks e.g. accept a number argument.

silverwind avatar Feb 25 '24 23:02 silverwind