Fixed errors
This commit is contained in:
parent
200fbb2360
commit
9b2d2c65ca
@ -355,7 +355,7 @@ export function strToIpv6(ipStr, retArr=true) {
|
||||
if (ipStr.length % 2 === 1) {
|
||||
ipStr = "0" + ipStr;
|
||||
}
|
||||
return BigInt("0x" + ipStr.replace(":", ""));
|
||||
return Number("0x" + ipStr.replace(":", ""));
|
||||
}
|
||||
let j = 0;
|
||||
const blocks = ipStr.split(":"),
|
||||
|
||||
@ -116,8 +116,7 @@ class Sort extends Operation {
|
||||
*/
|
||||
static _ipv6Sort(a, b) {
|
||||
const ipLib = require("../lib/IP.mjs");
|
||||
const numericalA = ipLib.strToIpv6(a, false),
|
||||
numericalB = ipLib.strToIpv6(b, false);
|
||||
const numericalA = ipLib.strToIpv6(a, false), numericalB = ipLib.strToIpv6(b, false);
|
||||
return numericalA < numericalB ? -1 : 1;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user