scinote-web/app/javascript/vue/shared/blobToBase64.js

10 lines
212 B
JavaScript
Raw Normal View History

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