Backend half
This commit is contained in:
1 parent
fa868e7c1d
commit
8600fa7c1d
19426 files changed
+3750448
-8108
No files matched your search
+9
@@ -0,0 +1,9 @@
|
||||
export async function blobReader(blob, onChunk, chunkSize = 1024 * 1024) {
|
||||
const size = blob.size;
|
||||
let totalBytesRead = 0;
|
||||
while (totalBytesRead < size) {
|
||||
const slice = blob.slice(totalBytesRead, Math.min(size, totalBytesRead + chunkSize));
|
||||
onChunk(new Uint8Array(await slice.arrayBuffer()));
|
||||
totalBytesRead += slice.size;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user