mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-09 07:45:00 -04:00
Added strToIpv6 import
This commit is contained in:
parent
0c0a035a53
commit
51a7cdff06
1 changed files with 2 additions and 2 deletions
|
@ -8,6 +8,7 @@
|
||||||
import Operation from "../Operation.mjs";
|
import Operation from "../Operation.mjs";
|
||||||
import Utils from "../Utils.mjs";
|
import Utils from "../Utils.mjs";
|
||||||
import {INPUT_DELIM_OPTIONS} from "../lib/Delim.mjs";
|
import {INPUT_DELIM_OPTIONS} from "../lib/Delim.mjs";
|
||||||
|
import {strToIpv6} from "../lib/IP.mjs";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sort operation
|
* Sort operation
|
||||||
|
@ -116,8 +117,7 @@ class Sort extends Operation {
|
||||||
* @returns {number}
|
* @returns {number}
|
||||||
*/
|
*/
|
||||||
static _ipv6Sort(a, b) {
|
static _ipv6Sort(a, b) {
|
||||||
const ipLib = require("../lib/IP.mjs");
|
const numericalA = strToIpv6(a, false), numericalB = strToIpv6(b, false);
|
||||||
const numericalA = ipLib.strToIpv6(a, false), numericalB = ipLib.strToIpv6(b, false);
|
|
||||||
return numericalA - numericalB;
|
return numericalA - numericalB;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue