Update IP.mjs
This commit is contained in:
parent
c9504ac675
commit
67886c886d
@ -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(":"),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user