Skip to content

NPM module that checks if a given IP address is part of a given CIDR block.

License

Notifications You must be signed in to change notification settings

fielmann-ag/cidr-block-check

Repository files navigation

cidr-block-check MIT License build

NPM module that checks if a given IP address is part of a given CIDR block.

Details about CIDR can be found here.

Installation

npm i cidr-block-check

Usage

import cidrBlockCheck from 'cidr-block-check';

const cidr = '192.168.0.0/22';
const ip = '192.168.2.10';

console.log(cidrBlockCheck.v4.isInBlock(cidr,ip));
// true

About

NPM module that checks if a given IP address is part of a given CIDR block.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published