const blob = function (data: string, mime: string) {
data = data.split(',')[1];
data = window.atob(data);
let ia = new Uint8Array(data.length);
for (var i = 0; i < data.length; i++) {
ia[i] = data.charCodeAt(i);
};
return new Blob([ia], {
type: mime
});
};
标签:编码,string,Base64,Blob,ia,new,data
From: https://www.cnblogs.com/mydyxy/p/17352963.html