1import { base64StringToBlob } from 'blob-util';
2
3const contentType = 'image/png';
4const b64Data = 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==';
5
6const blob = base64StringToBlob(b64Data, contentType);
7
8// Do whatever you need with your blob...
1const byteCharacters = atob(b64);
2const byteNumbers = new Array(byteCharacters.length);
3for (let i = 0; i < byteCharacters.length; i++) {
4 byteNumbers[i] = byteCharacters.charCodeAt(i);
5}
6const byteArray = new Uint8Array(byteNumbers);
7const blob = new Blob([byteArray], {type: 'audio/mp3'});
8