ip-set
IP Address Set
Efficient mutable set data structure optimized for use with IPv4 and IPv6 addresses. The primary use case is for working with potentially large IP blacklists.
Works in the browser with browserify! This module is used by WebTorrent.
install
npm install ip-set
usage
var ipSet = require('ip-set')()
ipSet.add(exampleBlockedIP1)
ipSet.add(exampleBlockedIP2)
var isBlocked = ipSet.contains(exampleBlockedIP2)
CIDR ip's are also supported
ipSet.add(`192.168.1.0/24`);
var isBlockedInList= ipSet.contains('192.168.1.0');
isBlockedInList= ipSet.contains('192.168.1.255');
todo
(prioritized highest to lowest)
credits
Original interval-tree written by galedric for torrent-stream. Ported to an isolated npm module by transitive-bullshit for webtorrent.
license
MIT. Copyright (c) Travis Fischer