Converts a Blob object into a Base64-encoded string.
Blob
A Promise that resolves to the Base64 string representation of the blob.
Promise
const blob = new Blob(['Hello, world!'], { type: 'text/plain' });const base64 = await convertBlobToBase64(blob);console.log(base64); // → 'SGVsbG8sIHdvcmxkIQ=='
FileReader.readAsDataURL
data:text/plain;base64,
The Blob to convert.
Generated using TypeDoc
Converts a
Blobobject into a Base64-encoded string.Returns
A
Promisethat resolves to the Base64 string representation of the blob.Example
Remarks
FileReader.readAsDataURLto serialize the blob.data:text/plain;base64,).