mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-10 00:05:11 -04:00
input type for toBase64
This commit is contained in:
parent
4c3324aea1
commit
400189f6ad
1 changed files with 7 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Operation from "../Operation.mjs";
|
import Operation from "../Operation.mjs";
|
||||||
|
import Utils from "../Utils.mjs";
|
||||||
import {toBase64, ALPHABET_OPTIONS} from "../lib/Base64.mjs";
|
import {toBase64, ALPHABET_OPTIONS} from "../lib/Base64.mjs";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,6 +30,11 @@ class ToBase64 extends Operation {
|
||||||
name: "Alphabet",
|
name: "Alphabet",
|
||||||
type: "editableOption",
|
type: "editableOption",
|
||||||
value: ALPHABET_OPTIONS
|
value: ALPHABET_OPTIONS
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Input",
|
||||||
|
"type": "option",
|
||||||
|
"value": ["Raw", "Hex"]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -40,6 +46,7 @@ class ToBase64 extends Operation {
|
||||||
*/
|
*/
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
const alphabet = args[0];
|
const alphabet = args[0];
|
||||||
|
input = Utils.strToArrayBuffer(Utils.convertToByteString(Utils.arrayBufferToStr(input), args[1]));
|
||||||
return toBase64(input, alphabet);
|
return toBase64(input, alphabet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue