New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cidr-tools

Package Overview
Dependencies
Maintainers
1
Versions
93
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.1.1 to 2.1.2

14

index.js

@@ -40,6 +40,2 @@ "use strict";

function prefix(size, v) {
return bits[v] - (bigint(String(size)).toString(2).match(/0/g) || []).length;
}
function uniq(arr) {

@@ -147,3 +143,3 @@ return [...new Set(arr)];

function subparts(part) {
const size = bigint(diff(part.end, part.start));
const size = diff(part.end, part.start);
const biggest = biggestPowerOfTwo(size);

@@ -174,8 +170,10 @@

a = a.add(bigint("1"));
return a.subtract(b).toString();
return a.subtract(b);
}
function formatPart(part, v) {
const d = diff(part.end, part.start);
return format(part.start, v) + "/" + prefix(d, v);
const ip = format(part.start, v);
const zeroes = diff(part.end, part.start).toString(2);
const prefix = bits[v] - (zeroes.match(/0/g) || []).length;
return `${ip}/${prefix}`;
}

@@ -182,0 +180,0 @@

{
"name": "cidr-tools",
"version": "2.1.1",
"version": "2.1.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