📅  最后修改于: 2022-03-11 14:58:41.438000             🧑  作者: Mango
function base64ToArrayBuffer(base64) {
let binaryString = window.atob(base64);
let binaryLength = binaryString.length;
let bytes = new Uint8Array(binaryLength);
for (let i = 0; i < binaryLength; i++) {
let ascii = binaryString.charCodeAt(i);
bytes[i] = ascii;
}
return bytes;
}