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.0.0 to 2.0.1

13

index.js

@@ -139,9 +139,11 @@ "use strict";

function biggestPowerOfTwo(num) {
if (num === 0) return 0;
return Math.pow(2, num.toString(2).length - 1);
if (num.compareTo(bigint("0")) === 0) return bigint("0");
const power = bigint(String(num.toString(2).length - 1));
return bigint("2").pow(power);
}
function subparts(part) {
const size = bigint(String(diff(part.end, part.start)));
const biggest = bigint(String(biggestPowerOfTwo(Number(size.toString()))));
const size = bigint(diff(part.end, part.start));
const biggest = biggestPowerOfTwo(size);
if (size.equals(biggest)) return [part];

@@ -169,3 +171,4 @@

if (b.constructor.name !== "BigInteger") b = bigint(b);
return Number((a.add(bigint("1"))).subtract(b).toString());
a = a.add(bigint("1"));
return a.subtract(b).toString();
}

@@ -172,0 +175,0 @@

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

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

@@ -49,4 +49,4 @@ # cidr-tools

- `networkA` *String*: A CIDR or IP addresses.
- `networkB` *String*: A CIDR or IP addresses.
- `networkA` *String*: A CIDR or IP address.
- `networkB` *String*: A CIDR or IP address.

@@ -57,3 +57,3 @@ Returns a boolean that indicates if the networks overlap (intersect) each other.

- `network` *String*: A CIDR or IP addresses.
- `network` *String*: A CIDR or IP address.

@@ -60,0 +60,0 @@ Returns a normalized representation of a IP or CIDR. Will not include a prefix on IPs.

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