bug fix
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import {CID_ALGORITHM_NAMES} from "@root/hash-compute/MultiHashData";
|
||||
import fs from "fs";
|
||||
import {Readable} from 'stream';
|
||||
import {computeCIDs as computeCIDsInternal} from "./ComputeHash";
|
||||
import {createHasher} from "@root/file-id/CreateHasher";
|
||||
|
||||
/**
|
||||
* Compute the CIDs of a file using specific algorithms
|
||||
@@ -12,6 +14,6 @@ export default async function computeCIDs({filePath, algorithms}: {
|
||||
filePath: string;
|
||||
algorithms: CID_ALGORITHM_NAMES[]
|
||||
}): Promise<string[]> {
|
||||
const stream = fs.createReadStream(filePath);
|
||||
return computeCIDsInternal({stream, algorithms});
|
||||
}
|
||||
const stream = Readable.toWeb(fs.createReadStream(filePath));
|
||||
return computeCIDsInternal({stream, algorithms, createHasher});
|
||||
}
|
||||
Reference in New Issue
Block a user