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 7.0.6 to 7.0.7

1

index.d.ts

@@ -14,2 +14,3 @@ type IPv4Address = string;

end: bigint;
single: boolean;
};

@@ -16,0 +17,0 @@

5

index.js

@@ -19,4 +19,4 @@ import {parseIp, stringifyIp, normalizeIp, ipVersion} from "ip-bigint";

function doNormalize(cidr, {compress = true, hexify = false} = {}) {
const {start, end, prefix, version} = parse(cidr);
if (start !== end) { // cidr
const {start, prefix, single, version} = parse(cidr);
if (!single) { // cidr
// set network address to first address

@@ -62,2 +62,3 @@ const ip = normalizeIp(stringifyIp({number: start, version}), {compress, hexify});

parsed.prefix = prefix;
parsed.single = prefix === String(bits[parsed.version]);
const {number, version} = parseIp(ip);

@@ -64,0 +65,0 @@ const numBits = bits[version];

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

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

@@ -82,2 +82,4 @@ # cidr-tools

- `end` BigInt: End number of the network.
- `end` BigInt: Start of the network.
- `single` Boolean: `true` when the network is a single IP.

@@ -84,0 +86,0 @@ ## Related

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