Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ip-cidr

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ip-cidr - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

16

index.js

@@ -43,3 +43,3 @@ "use strict";

if (options.type == "bigInteger") {
return address.bigInteger();
return new BigInteger(address.bigInteger().toString());
}

@@ -92,4 +92,4 @@ else if (options.type == "addressObject") {

const list = [];
const start = this.addressStart.bigInteger();
const end = this.addressEnd.bigInteger();
const start = this.formatIP(this.addressStart, { type: 'bigInteger' });
const end = this.formatIP(this.addressEnd, { type: 'bigInteger' });
const length = end.subtract(start).add(new BigInteger('1'));

@@ -114,4 +114,4 @@ const info = this.getChunkInfo(length, options);

const promise = [];
const start = this.addressStart.bigInteger();
const end = this.addressEnd.bigInteger();
const start = this.formatIP(this.addressStart, { type: 'bigInteger' });
const end = this.formatIP(this.addressEnd, { type: 'bigInteger' });
const length = end.subtract(start).add(new BigInteger('1'));

@@ -147,7 +147,7 @@ const info = this.getChunkInfo(length, options);

let maxLength;
const addressBigInteger = this.address.bigInteger();
const addressBigInteger = this.formatIP(this.address, { type: 'bigInteger' });
function getBigInteger(val) {
const getBigInteger = (val) => {
if(typeof val == 'string' && val.match(/:|\./)) {
return createAddress(val).bigInteger().subtract(addressBigInteger);
return this.formatIP(createAddress(val), { type: 'bigInteger' }).subtract(addressBigInteger);
}

@@ -154,0 +154,0 @@ else if(typeof val != 'object') {

{
"name": "ip-cidr",
"version": "2.1.1",
"version": "2.1.2",
"description": "Module for working with CIDR (v4, v6)",

@@ -31,3 +31,3 @@ "main": "./index.js",

"ip-address": "^6.3.0",
"jsbn": "^0.1.0"
"jsbn": "^1.1.0"
},

@@ -34,0 +34,0 @@ "devDependencies": {

@@ -61,3 +61,3 @@ "use strict";

const cidr = new IPCIDR(validCIDR);
assert.equal(JSON.stringify(cidr.address.bigInteger()), JSON.stringify(cidr.formatIP(cidr.address, { type: "bigInteger" })));
assert.equal(JSON.stringify(cidr.formatIP(cidr.address, { type: 'bigInteger' })), JSON.stringify(cidr.formatIP(cidr.address, { type: "bigInteger" })));
});

@@ -64,0 +64,0 @@

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc