From 7f7f3fa0cfcbe3e7c34c8773e2df698412d2c82c Mon Sep 17 00:00:00 2001 From: archmoj Date: Sun, 29 Nov 2020 20:21:28 -0500 Subject: [PATCH] reduce lookup size, b64 chars are between 43 & 122 --- lib/base64-arraybuffer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/base64-arraybuffer.js b/lib/base64-arraybuffer.js index e6b6306..3e50e64 100644 --- a/lib/base64-arraybuffer.js +++ b/lib/base64-arraybuffer.js @@ -11,7 +11,7 @@ var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; // Use a lookup table to find the index. - var lookup = new Uint8Array(256); + var lookup = new Uint8Array(123); // max ASCII code in chars is 122 for (var i = 0; i < chars.length; i++) { lookup[chars.charCodeAt(i)] = i; }