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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offsetting addresses #118

Open
napei opened this issue Oct 25, 2020 · 0 comments
Open

Offsetting addresses #118

napei opened this issue Oct 25, 2020 · 0 comments

Comments

@napei
Copy link

napei commented Oct 25, 2020

So found this library. Great job 馃憤

I would make a PR but I'm swamped at the moment, but in terms of a useful addition.

nextNetwork or nextSubnet which would return the address or subnet representing the next available address, i.e. the address after the broadcast address. Useful for VLSM/CIDR calculation where you want to get the next address. Essentially taking the broadcast address and adding one to it.

or

offsetAddress or something similar. Give it a positive or negative integer n, and return an address which is n addresses away from that ip. Same as above but a more general case. Not sure how to handle the case of overflowing a specified subnet, however, maybe that's not a problem. Maybe even a chainable method like .add() or .sub()

Essentially mathematical operations on ip addresses. Can be useful for address allocation and such also, where you want to iterate through the addresses in a subnet and do something with them.

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

1 participant