Update Base64Decode.js

The array length should be 1/4 the size of the raw binary string, otherwise you end up with a bunch of undefined array values at the end.
This commit is contained in:
Mike Kruk 2018-05-02 19:39:56 -04:00 committed by GitHub
parent be4303e6e6
commit c0ce45cfa3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,7 +18,7 @@ var Base64Decode = function (data)
{
var binaryString = window.atob(data);
var len = binaryString.length;
var bytes = new Array(len);
var bytes = new Array(len / 4);
// Interpret binaryString as an array of bytes representing little-endian encoded uint32 values.
for (var i = 0; i < len; i += 4)