Skip to content

Commit 7f7f3fa

Browse files
committed
reduce lookup size, b64 chars are between 43 & 122
1 parent 29d0f82 commit 7f7f3fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/base64-arraybuffer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
1212

1313
// Use a lookup table to find the index.
14-
var lookup = new Uint8Array(256);
14+
var lookup = new Uint8Array(123); // max ASCII code in chars is 122
1515
for (var i = 0; i < chars.length; i++) {
1616
lookup[chars.charCodeAt(i)] = i;
1717
}

0 commit comments

Comments
 (0)