function base64ToUint8Array(base64String) { var base64 = base64String.replace(/^data:image\/\w+;base64,/, ""); const rawData = window.atob(base64); const outputArray = new Uint8Array(rawData.length); for (let i = 0; i < rawData.length; ++i) { outputArray[i] = rawData.charCodeAt(i); } return outputArray; }
标签:const,ArrayBuffer,base64,outputArray,length,rawData From: https://www.cnblogs.com/slxcc/p/16962815.html