Skip to content

Commit a1c68d8

Browse files
authored
Merge pull request #77 from Constellation/base64
Use Uint8Array.fromBase64 instead of atob
2 parents f75f42a + 856305a commit a1c68d8

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

wasm/tfjs-model-helpers.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,7 @@ function arrayBufferToBase64(buffer) {
8585
}
8686

8787
function base64ToArrayBuffer(base64) {
88-
var binary_string = atob(base64);
89-
var len = binary_string.length;
90-
var bytes = new Uint8Array(len);
91-
for (var i = 0; i < len; i++) {
92-
bytes[i] = binary_string.charCodeAt(i);
93-
}
94-
return bytes.buffer;
88+
return Uint8Array.fromBase64(base64).buffer;
9589
}
9690

9791
function equal(buf1, buf2) {

0 commit comments

Comments
 (0)