ip-bigint
Advanced tools
Comparing version 8.0.1 to 8.0.2
@@ -26,4 +26,4 @@ export const max4 = 2n ** 32n - 1n; | ||
if (part.includes(".")) { | ||
const digits = part.split(".").map(str => Number(str).toString(16).padStart(2, "0")); | ||
return `${digits[0]}${digits[1]}:${digits[2]}${digits[3]}`; | ||
const [a, b, c, d] = part.split(".").map(str => Number(str).toString(16).padStart(2, "0")); | ||
return `${a}${b}:${c}${d}`; | ||
} else { | ||
@@ -30,0 +30,0 @@ return part; |
{ | ||
"name": "ip-bigint", | ||
"version": "8.0.1", | ||
"description": "Convert IPv4 and IPv6 addresses to native BigInt and vice-versa", | ||
"version": "8.0.2", | ||
"description": "Convert IPv4 and IPv6 addresses to and from native BigInt", | ||
"author": "silverwind <me@silverwind.io>", | ||
@@ -18,9 +18,9 @@ "repository": "silverwind/ip-bigint", | ||
"devDependencies": { | ||
"eslint": "8.53.0", | ||
"eslint-config-silverwind": "79.3.3", | ||
"eslint": "8.56.0", | ||
"eslint-config-silverwind": "79.4.0", | ||
"updates": "15.0.4", | ||
"versions": "12.0.0", | ||
"vitest": "0.34.6", | ||
"vitest-config-silverwind": "3.0.0" | ||
"vitest": "1.1.0", | ||
"vitest-config-silverwind": "5.0.0" | ||
} | ||
} |
# ip-bigint | ||
[![](https://img.shields.io/npm/v/ip-bigint.svg?style=flat)](https://www.npmjs.org/package/ip-bigint) [![](https://img.shields.io/npm/dm/ip-bigint.svg)](https://www.npmjs.org/package/ip-bigint) [![](https://img.shields.io/bundlephobia/minzip/ip-bigint.svg)](https://bundlephobia.com/package/ip-bigint) [![](https://packagephobia.com/badge?p=ip-bigint)](https://packagephobia.com/result?p=ip-bigint) | ||
> Convert IPv4 and IPv6 addresses to native BigInt and vice-versa | ||
> Convert IPv4 and IPv6 addresses to and from native BigInt | ||
@@ -6,0 +6,0 @@ ## Usage |
6689