ip_to_cidr
v2.0.3
Published
This will return the cidr of an ip with the list of cidr given
Downloads
4
Maintainers
Readme
IP CHECK RANGE CIDR
Installing
npm install ip_to_cidr --save
IPv4 && IPv6
var ipRange = require("ip_to_cidr");
ipRange("192.168.1.1", ["102.1.5.2/24", "192.168.1.0/24", "106.1.180.84"])
// 192.168.1.0/24
ipRange("195.58.1.62", ["::1/128", "125.92.12.53"])
// null
ipRange("0:0:0:0:0:FFFF:222.1.41.90", "222.1.41.0/24")
// > 222.1.41.0/24
ipRange("2001:cdba:0000:0000:0000:0000:3257:9652", ["2001:cdba::3257:9652","::1/128"])
// > 2001:cdba::3257:9652
Developing
To run the tests:
npm test