🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

ip-class

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ip-class

Get the IPv4 address class of an ip address for classful networks

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

ip-class Travis XO code style

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.

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

Keywords

subnet

FAQs

Package last updated on 31 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts