mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-16 14:17:00 +08:00
10 lines
212 B
JavaScript
10 lines
212 B
JavaScript
|
export function blobToBase64(blob) {
|
||
|
const reader = new FileReader();
|
||
|
reader.readAsDataURL(blob);
|
||
|
return new Promise(resolve => {
|
||
|
reader.onloadend = () => {
|
||
|
resolve(reader.result);
|
||
|
};
|
||
|
});
|
||
|
}
|