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.6 to 2.2.7

17

index.js

@@ -145,2 +145,11 @@ "use strict";

function subparts(part) {
// special case for when part is length 1
if (part.end.subtract(part.start).compareTo(one) === 0) {
if (part.end.remainder(two).equals(zero)) {
return [{start: part.start, end: part.start}, {start: part.end, end: part.end}];
} else {
return [{start: part.start, end: part.end}];
}
}
const size = diff(part.end, part.start);

@@ -158,7 +167,13 @@ let biggest = biggestPowerOfTwo(size);

start = part.end.divide(biggest).multiply(biggest);
// start is not matching on the size-defined boundary - 4-16, use 8-16
if (start.add(biggest).subtract(one).compareTo(part.end) > 0) {
biggest = biggest.divide(two);
// divide will floor to nearest integer
start = part.end.divide(biggest).subtract(one).multiply(biggest);
while (start.compareTo(part.start) < 0) {
biggest = biggest.divide(two);
start = part.end.divide(biggest).subtract(one).multiply(biggest);
}
end = start.add(biggest).subtract(one);

@@ -165,0 +180,0 @@ } else {

8

package.json
{
"name": "cidr-tools",
"version": "2.2.6",
"version": "2.2.7",
"author": "silverwind <me@silverwind.io>",

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

"devDependencies": {
"eslint": "^5.11.0",
"eslint-config-silverwind": "^2.0.12",
"updates": "^6.0.2",
"eslint": "^5.12.1",
"eslint-config-silverwind": "^2.0.14",
"updates": "^6.2.1",
"ver": "^3.0.1"
}
}
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