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

cidr-tools

Package Overview
Dependencies
Maintainers
1
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cidr-tools - npm Package Compare versions

Comparing version 2.2.1 to 2.2.2

25

index.js

@@ -148,6 +148,6 @@ "use strict";

if (size.equals(biggest)) return [part];
let start, end;
if (part.start.remainder(biggest).equals(zero)) {
if (size.equals(biggest) && part.start.add(size).compareTo(part.end) === 0) {
return [part];
} else if (part.start.remainder(biggest).equals(zero)) {
// start is matching on the size-defined boundary - ex: 0-12, use 0-8

@@ -159,8 +159,15 @@ start = part.start;

start = part.end.divide(biggest).multiply(biggest);
end = start.add(biggest).subtract(one);
if (start.add(biggest).subtract(one).compareTo(part.end) > 0) {
// divide will floor to nearest integer
end = start.add(biggest.divide(two)).subtract(one);
} else {
end = start.add(biggest).subtract(one);
}
}
if (end.compareTo(part.end) > 0) process.exit();
let parts = [{start, end}];
// // additional subnets on left side
// additional subnets on left side
if (!start.equals(part.start)) {

@@ -300,8 +307,10 @@ parts = parts.concat(subparts({start: part.start, end: start.subtract(one)}));

for (const exclcidr of excls[v]) {
const excl = parse(exclcidr);
for (const [index, basecidr] of bases[v].entries()) {
const base = parse(basecidr);
const excl = parse(exclcidr);
const remainders = exclude(base, excl, v);
bases[v] = bases[v].concat(remainders);
bases[v].splice(index, 1);
if (base.toString() !== remainders.toString()) {
bases[v] = bases[v].concat(remainders);
bases[v].splice(index, 1);
}
}

@@ -308,0 +317,0 @@ }

{
"name": "cidr-tools",
"version": "2.2.1",
"version": "2.2.2",
"author": "silverwind <me@silverwind.io>",

@@ -5,0 +5,0 @@ "description": "Tools to work with IPv4 and IPv6 CIDR network lists",

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