mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-09 15:55:01 -04:00
Fixed errors
This commit is contained in:
parent
200fbb2360
commit
9b2d2c65ca
2 changed files with 2 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue