Fix other scripts

This commit is contained in:
garronej
2023-03-19 16:58:26 +01:00
parent 2b6c991190
commit 59d47592d9
4 changed files with 61 additions and 58 deletions

View File

@ -42,6 +42,7 @@ export function crc32(input: Readable | String | Buffer): Promise<number> {
} else if (input instanceof Readable) {
return new Promise<number>((resolve, reject) => {
let crc = ~0;
input.setMaxListeners(Infinity);
input.on("end", () => resolve((crc ^ -1) >>> 0));
input.on("error", e => reject(e));
input.on("data", (chunk: Buffer) => {