Socket
Socket
Sign inDemoInstall

ip-subnet-calculator

Package Overview
Dependencies
0
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 2.0.1

2

package.json

@@ -6,3 +6,3 @@ {

"homepage": "https://github.com/salieri/IPSubnetCalculator",
"version": "2.0.0",
"version": "2.0.1",
"files": [

@@ -9,0 +9,0 @@ "lib",

@@ -1,12 +0,8 @@

IP Subnet Calculator
=================
# IP Subnet Calculator
This module calculates optimal subnet masks for non-standard IP ranges, e.g. `5.4.3.21 - 6.7.8.9`
JavaScript class for calculating optimal subnet masks for non-standard IP ranges, e.g. `5.4.3.21 - 6.7.8.9`
[View demo](http://salieri.github.io/IPSubnetCalculator/)
What does it do?
----------------
## What does it do?
* Calculates subnet masks for standard and non-standard IP ranges. For example, `10.0.0.5 - 10.0.0.23` will result in `10.0.0.5/32, 10.0.0.6/31, 10.0.0.8/29, 10.0.0.16/29`.

@@ -17,5 +13,3 @@ * Calculates CIDR prefixes from subnet masks, e.g. `10.0.0.5/255.255.128.0` will result in `10.0.0.0/17`.

Support
-------
## Support
* Node.js

@@ -25,5 +19,3 @@ * Direct browser use

Installation
------------
## Installation
```sh

@@ -34,4 +26,3 @@ > npm install ip-subnet-calculator

Node.js
-------
## Node.js
```javascript

@@ -47,5 +38,3 @@ import * as IPSubnetCalculator from 'ip-subnet-calculator';

Direct browser use
------------------
## Direct browser use
```html

@@ -63,6 +52,5 @@ <script src='lib/ip-subnet-calculator.browser.js'></script>

API
---
### IpSubnetCalculator.calculate(ipStart, ipEnd) ###
## API
### IpSubnetCalculator.calculate(ipStart, ipEnd)
Calculates an optimal set of IP masks for the given IP address range.

@@ -111,5 +99,3 @@

### IpSubnetCalculator.calculateSubnetMask(ip, prefixSize) ###
### IpSubnetCalculator.calculateSubnetMask(ip, prefixSize)
Calculates a subnet mask from CIDR prefix.

@@ -123,5 +109,3 @@

### IpSubnetCalculator.calculateCIDRPrefix(ip, subnetMask) ###
### IpSubnetCalculator.calculateCIDRPrefix(ip, subnetMask)
Calculates a CIDR prefix from subnet mask.

@@ -136,6 +120,5 @@

## Test Functions ##
## Test Functions
### IpSubnetCalculator.isIp(ipStr) ###
### IpSubnetCalculator.isIp(ipStr)
Tests whether string is an IP address.

@@ -147,4 +130,3 @@

### IpSubnetCalculator.isDecimalIp(ipNum) ###
### IpSubnetCalculator.isDecimalIp(ipNum)
Tests whether `ipNum` is a decimal IP address.

@@ -157,6 +139,5 @@

## Conversion Functions ##
## Conversion Functions
### IpSubnetCalculator.toDecimal(ip) ###
### IpSubnetCalculator.toDecimal(ip)
Calculates a decimal integer from an string IP address.

@@ -172,4 +153,3 @@

### IpSubnetCalculator.toString(num) ###
### IpSubnetCalculator.toString(num)
> *num* (`number|string`) Decimal representation of an IP address.

@@ -183,7 +163,5 @@

License
-------
## License
[MIT](http://opensource.org/licenses/MIT)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc