fix: oshash exception
This commit is contained in:
parent
0d3128948b
commit
39d66e5280
@ -20,6 +20,10 @@ export async function oshash(
|
||||
let hash = BigInt(st.size);
|
||||
|
||||
if (st.size < minFileSize){
|
||||
if (st.size < 8) {
|
||||
fd.close();
|
||||
throw new Error("Too short to hash");
|
||||
}
|
||||
// Although the original oshash algorithm should throw an exception,
|
||||
// just applying the hash function.
|
||||
const chunk = new Uint8Array(st.size);
|
||||
|
Loading…
Reference in New Issue
Block a user