We're a place where coders share, stay up-to-date and grow their careers.
Here's mine! I extended it a little to work if the start and end were reversed.
const convertIPStringToNumber = ipString => ipString.split(".") .reduce((acc, part) => (acc << 8) | Number(part), 0); const ipsBetween = (start, finish) => Math.abs(convertIPStringToNumber(finish) - convertIPStringToNumber(start));
Gist: gist.github.com/kerrishotts/797450...
Here's mine! I extended it a little to work if the start and end were reversed.
Gist: gist.github.com/kerrishotts/797450...