Closed jhuckaby closed 10 months ago
Currently there is no suitable exported function for this, but it may be possible to add the inverse of parse
, e.g. stringify
, where you would modify at least start
and end
:
[Object: null prototype] {
single: true,
cidr: '1.1.1.0/32',
version: 4,
prefix: '32',
start: 16843008n,
end: 16843008n
}
E.g. stringify({start: parse("1.0.0.0").start, end: parse("1.0.0.255").start})
, but likely it should have a more easy to use methods to convert from and to ranges. Not sure if this really fits the spirit of this module.
I totally understand. Thank you for the reply! I agree it doesn't really fit into your module's API. Closing this issue now. Have a great rest of your weekend!
Please forgive the question. I have read the docs, but I cannot see if this is possible with cidr-tools. What I want is to start with something like as the input:
And end up with this as the output:
Does cidr-tools have a function to perform this conversion, or am I barking up the wrong tree?
(If barking up the wrong tree, do you know of a module that can perform this kind of transformation?)
Thank you so much for your work.