scinote-web/app/javascript/vue/shared/blobToBase64.js
2023-08-02 14:13:04 +02:00

9 lines
212 B
JavaScript

export function blobToBase64(blob) {
const reader = new FileReader();
reader.readAsDataURL(blob);
return new Promise(resolve => {
reader.onloadend = () => {
resolve(reader.result);
};
});
}