MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / readStreamToHash

Method readStreamToHash

daemon/src/entity/file_writer.ts:189–200  ·  view source on GitHub ↗
(
    filePath: string,
    hash: any,
    options?: { start: number; end: number }
  )

Source from the content-addressed store, hash-verified

187 }
188
189 private readStreamToHash(
190 filePath: string,
191 hash: any,
192 options?: { start: number; end: number }
193 ): Promise<void> {
194 return new Promise((resolve, reject) => {
195 const stream = fs.createReadStream(filePath, options);
196 stream.on("data", (chunk) => hash.update(chunk));
197 stream.on("end", resolve);
198 stream.on("error", reject);
199 });
200 }
201}

Callers

nothing calls this directly

Calls 2

onMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected