MCPcopy Create free account
hub / github.com/cloudflare/computer / flush

Function flush

packages/dofs/src/fs/writeFile.ts:173–177  ·  view source on GitHub ↗
(chunk: Uint8Array)

Source from the content-addressed store, hash-verified

171 let carry: Uint8Array | undefined;
172
173 const flush = (chunk: Uint8Array): void => {
174 const hash = sha256(chunk);
175 stageBlob(db, hash, chunk, mtime);
176 chunkRefs.push({ hash, size: chunk.byteLength });
177 };
178
179 const reader = source.getReader();
180 try {

Callers 1

writeFileStreamingFunction · 0.70

Calls 3

stageBlobFunction · 0.85
sha256Function · 0.70
pushMethod · 0.65

Tested by

no test coverage detected