-
Notifications
You must be signed in to change notification settings - Fork 152
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
Range / CIDR conversion utility #37
Comments
I think we have almost all the base code needed to do this already so that should be good! |
Any idea for the name of a tool like this? This would also be the subcommand. Some ideas:
|
Or two tools that do each separately:
|
Yeah I like 2 tools named cidr2range and range2cidr |
Great, those names might also be easier to get & discover on distribution repos like homebrew/apt. |
@coderholic A question about ranges that don't combine nicely into a single CIDR: What to do about a range like |
Just print both, and if so with a comma delimiter between them? Or skip these cases by default with a flag to force outputting multiple CIDRs if necessary? |
For reference, we had a chat and the answer is if we encounter input like:
we'd output the 2 CIDR result as:
i.e. copying the surrounding data per CIDR. |
This'll be available in the v2 release fairly soon. Just wrapping it up. |
When it's released, if there are any other issues let's make new issues for it. |
Are there Hombrew tap issues to track progress on adding |
I'll make PRs for getting these on the official homebrew tap tomorrow my time, yes. No point really adding them to the IPinfo tap at this point since it'll be replaced pretty quickly I reckon, given the good feedback we got from the homebrew guys on the previous stuff. |
Made PRs for Homebrew: cidr2range: Homebrew/homebrew-core#78164 |
Awesome 🥳 Thanks a lot! |
Another utility that it'd be great to add to the cli is the ability to convert from cidr to start,end ranges. We commonly do this internally at IPinfo, and our customers sometimes need to do it with our data exports too.
Eg. input:
1.1.1.0,1.1.1.255,other data
Output:
1.1.1.0/24,other data
And vice versa. Should probably support a different range sepator too (eg. 1.1.1.0-1.1.1.255).
The text was updated successfully, but these errors were encountered: