From 129fa919b935d97d995bc6b457c7f6984c06e825 Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Wed, 22 Aug 2018 16:32:31 +0200 Subject: js: improve decryption performance -- * src/Connection.js, src/Helpers.js: performance of decoding incoming base64 data was improved to about 4 times the speed by introducing two more efficient functions (thanks to rrenkert@intevation.de for finding and testing them) * src/gpgmejs.js: Decrypted data will now return as Uint8Array, if the caller does not wish for a decoding. Decoding binary data will return invalid data, and a Uint8Array may be desired. This can be indicated by using the (new) 'binary' option in decrypt. * src/Errors.js A new error in case this decoding fails * src/Message.js, src/Connection.js: expected is change from base64 to binary, to avoid confusion later on. --- lang/js/src/Errors.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lang/js/src/Errors.js') diff --git a/lang/js/src/Errors.js b/lang/js/src/Errors.js index 73418028..145c3a59 100644 --- a/lang/js/src/Errors.js +++ b/lang/js/src/Errors.js @@ -103,6 +103,10 @@ export const err_list = { msg: 'Invalid parameter was found', type: 'error' }, + 'DECODE_FAIL': { + msg: 'Decoding failed due to unexpected data', + type: 'error' + }, 'PARAM_IGNORED': { msg: 'An parameter was set that has no effect in gpgmejs', type: 'warning' -- cgit v1.2.3