ip-class
v1.0.1
Published
Get the IPv4 address class of an ip address for classful networks
Downloads
8
Maintainers
Readme
ip-class
Get the IPv4 address class of an ip address for classful networks
Install
$ npm install --save ip-class
Usage
const ipClass = require('ip-class');
ipClass('127.255.255.255');
//=> 'A'
ipClass('191.255.255.255');
//=> 'B'
ipClass('223.255.255.255');
//=> 'C'
ipClass('239.255.255.255');
//=> 'D'
ipClass('255.255.255.254');
//=> 'E'
API
ipClass(ip)
Returns the class of the ip
ip
Type: string
A valid IPv4 address.
Related
min-host-bits - 💻 Calculate minimum host bits needed for desired number of hosts
min-prefix-length - 🔢 Calculate the minimum prefix length for an IPv4 subnet based on a desired number of host
License
MIT © Brandon Him