This commit is contained in:
Pierre
2026-01-08 15:12:08 +01:00
parent 08c7479a1a
commit 1f0412d220
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -14,6 +14,6 @@ export default async function computeCIDs({filePath, algorithms}: {
filePath: string; filePath: string;
algorithms: CID_ALGORITHM_NAMES[] algorithms: CID_ALGORITHM_NAMES[]
}): Promise<string[]> { }): Promise<string[]> {
const stream = Readable.toWeb(fs.createReadStream(filePath)); const stream = Readable.toWeb(fs.createReadStream(filePath)) as ReadableStream<Uint8Array>;
return computeCIDsInternal({stream, algorithms, createHasher}); return computeCIDsInternal({stream, algorithms, createHasher});
} }
+1 -1
View File
@@ -20,7 +20,7 @@ export class HashComputerFile implements ComputeInterface{
} }
// Compute only the needed CIDs // Compute only the needed CIDs
const stream = Readable.toWeb(fs.createReadStream(filePath)); const stream = Readable.toWeb(fs.createReadStream(filePath)) as ReadableStream<Uint8Array>;
const cids = await computeCIDs({stream, algorithms:neededHashes,createHasher}); const cids = await computeCIDs({stream, algorithms:neededHashes,createHasher});
// Map the computed CIDs back to their respective metadata properties // Map the computed CIDs back to their respective metadata properties