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

ip-address

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ip-address - npm Package Compare versions

Comparing version 5.8.3 to 5.8.4

35

lib/ipv6.js

@@ -208,2 +208,37 @@ 'use strict';

/**
* Return an address from ip6.arpa form
* @memberof Address6
* @static
* @param {string} arpaFormAddress - an 'ip6.arpa' form address
* @returns {Adress6}
* @example
* var address = Address6.fromArpa(e.f.f.f.3.c.2.6.f.f.f.e.6.6.8.e.1.0.6.7.9.4.e.c.0.0.0.0.1.0.0.2.ip6.arpa.)
* address.correctForm(); // '2001:0:ce49:7601:e866:efff:62c3:fffe'
*/
Address6.fromArpa = function (arpaFormAddress) {
//remove ending ".ip6.arpa." or just "."
var address = arpaFormAddress.replace(/(\.ip6\.arpa)?\.$/, '');
var semicolonAmount = 7;
//correct ip6.arpa form with ending removed will be 63 characters
if (address.length !== 63) {
address = {
error: "Not Valid 'ip6.arpa' form",
address: null
};
return address;
}
address = address.split('.').reverse();
for (var i = semicolonAmount; i > 0; i--) {
var insertIndex = i * 4;
address.splice(insertIndex, 0, ':');
}
address = address.join('');
return new Address6(address);
};
/*

@@ -210,0 +245,0 @@ * A helper function to compact an array

6

package.json

@@ -10,3 +10,3 @@ {

],
"version": "5.8.3",
"version": "5.8.4",
"author": "Beau Gunderson <beau@beaugunderson.com> (https://beaugunderson.com/)",

@@ -20,6 +20,2 @@ "license": "MIT",

},
"bin": {
"ipv6": "bin/ipv6.js",
"ipv6grep": "bin/ipv6grep.js"
},
"engines": {

@@ -26,0 +22,0 @@ "node": ">= 0.10"

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