📜  将 base64 转换为 uint8array javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:11.508000             🧑  作者: Mango

代码示例1
function _base64ToArrayBuffer(base64) {
    var binary_string = window.atob(base64);
    var len = binary_string.length;
    var bytes = new Uint8Array(len);
    for (var i = 0; i < len; i++) {
        bytes[i] = binary_string.charCodeAt(i);
    }
    return bytes.buffer;
}