input type for toBase64
This commit is contained in:
parent
4c3324aea1
commit
400189f6ad
@ -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…
x
Reference in New Issue
Block a user