From 400189f6ad694aec84d6fe6f72c67da1a68ad18c Mon Sep 17 00:00:00 2001 From: n1073645 Date: Thu, 25 Jun 2020 13:40:36 +0100 Subject: [PATCH] input type for toBase64 --- src/core/operations/ToBase64.mjs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/operations/ToBase64.mjs b/src/core/operations/ToBase64.mjs index 53516a9f..cbdb9a58 100644 --- a/src/core/operations/ToBase64.mjs +++ b/src/core/operations/ToBase64.mjs @@ -5,6 +5,7 @@ */ import Operation from "../Operation.mjs"; +import Utils from "../Utils.mjs"; import {toBase64, ALPHABET_OPTIONS} from "../lib/Base64.mjs"; /** @@ -29,6 +30,11 @@ class ToBase64 extends Operation { name: "Alphabet", type: "editableOption", value: ALPHABET_OPTIONS + }, + { + "name": "Input", + "type": "option", + "value": ["Raw", "Hex"] } ]; } @@ -40,6 +46,7 @@ class ToBase64 extends Operation { */ run(input, args) { const alphabet = args[0]; + input = Utils.strToArrayBuffer(Utils.convertToByteString(Utils.arrayBufferToStr(input), args[1])); return toBase64(input, alphabet); }