mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-23 08:16:17 -04:00
Exporing options with API.
This commit is contained in:
parent
30aa4e05ef
commit
59877b5138
5 changed files with 149 additions and 17 deletions
|
@ -240,6 +240,26 @@ class Dish {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
findType() {
|
||||
if (!this.value) {
|
||||
throw "Dish has no value";
|
||||
}
|
||||
|
||||
const types = [Dish.BYTE_ARRAY, Dish.STRING, Dish.HTML, Dish.NUMBER, Dish.ARRAY_BUFFER, Dish.BIG_NUMBER, Dish.LIST_FILE];
|
||||
|
||||
types.find((type) => {
|
||||
this.type = type;
|
||||
if (this.valid()) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
return this.type;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determines how much space the Dish takes up.
|
||||
|
|
|
@ -45,7 +45,6 @@ class ToBase32 extends Operation {
|
|||
chr1, chr2, chr3, chr4, chr5,
|
||||
enc1, enc2, enc3, enc4, enc5, enc6, enc7, enc8,
|
||||
i = 0;
|
||||
|
||||
while (i < input.length) {
|
||||
chr1 = input[i++];
|
||||
chr2 = input[i++];
|
||||
|
@ -76,7 +75,6 @@ class ToBase32 extends Operation {
|
|||
alphabet.charAt(enc4) + alphabet.charAt(enc5) + alphabet.charAt(enc6) +
|
||||
alphabet.charAt(enc7) + alphabet.charAt(enc8);
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue