Skip to content

Commit 708a72e

Browse files
authored
Merge pull request #169 from filipefigcorreia/bugfix/fix-rangeerror-when-decoding-base64
Fix RangeError when decoding base64
2 parents bac7f82 + 63da7cf commit 708a72e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nodejs/scripts/jsonix.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4397,7 +4397,7 @@ Jsonix.Schema.XSD.Base64Binary = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, {
43974397

43984398
input = text.replace(/[^A-Za-z0-9\+\/\=]/g, "");
43994399

4400-
var length = (input.length / 4) * 3;
4400+
var length = Math.floor(input.length / 4 * 3);
44014401
if (input.charAt(input.length - 1) === "=") {
44024402
length--;
44034403
}

0 commit comments

Comments
 (0)