Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request : Split CIDR into evenvly sized chuncks #21

Open
poirazis opened this issue Feb 25, 2024 · 1 comment
Open

Feature Request : Split CIDR into evenvly sized chuncks #21

poirazis opened this issue Feb 25, 2024 · 1 comment

Comments

@poirazis
Copy link

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

@silverwind
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants