@graphteon/juricode
Version:
We are forging the future with lines of digital steel
16 lines • 606 B
JavaScript
export const base64ToBlob = (base64) => {
const base64WithoutPrefix = base64.split(",")[1] || base64;
const bytes = atob(base64WithoutPrefix);
const chunkSize = 8192;
const chunks = [];
for (let i = 0; i < bytes.length; i += chunkSize) {
const chunk = bytes.slice(i, i + chunkSize);
const array = new Uint8Array(chunk.length);
for (let j = 0; j < chunk.length; j += 1) {
array[j] = chunk.charCodeAt(j);
}
chunks.push(array);
}
return new Blob(chunks, { type: "application/zip" });
};
//# sourceMappingURL=base64-to-blob.js.map