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.
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
ornextSubnet
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 integern
, and return an address which isn
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.