Update IP.mjs

This commit is contained in:
Michael Rowley 2021-12-30 02:55:22 +00:00
parent c9504ac675
commit 67886c886d

View file

@ -352,10 +352,7 @@ export function ipv4ToStr(ipInt) {
export function strToIpv6(ipStr, retArr=true) {
if (retArr === false) {
// TODO: Expand address.
if (ipStr.length % 2 === 1) {
ipStr = "0" + ipStr;
}
return Number("0x" + ipStr.replace(":", ""));
return Number("0x" + ipStr.replace(/\:/g, ''));
}
let j = 0;
const blocks = ipStr.split(":"),