0.0.5 • Published 5 years ago

dv-ip-range v0.0.5

Weekly downloads
9
License
-
Repository
-
Last release
5 years ago

IP Range

A pilot library that provides a function that accepts two valid IPv4 addresses in the form of strings, and returns the number of addresses between them (including the first one, excluding the last one).

Inspired by Count IP Addresses Kata from Codewars: https://www.codewars.com/kata/526989a41034285187000de4

Use

Run npm install dv-ip-range to install the package

Import IpRange service:

import { DvIpRangeService as IpRangeService } from "dv-ip-range";

Add IpRange property to your components constructor:

constructor(private ipRange: IpRangeService) {

Call the countIpAddresses function:

this.range = ipRange.countIpAddresses("10.0.0.0", "10.0.0.50"); // 50
0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago