1 |
|
2 |
|
3 | import { Transform } from 'stream';
|
4 | import { CRC32CValidatorGenerator } from './crc32c';
|
5 | interface HashStreamValidatorOptions {
|
6 |
|
7 | crc32c: boolean;
|
8 |
|
9 | md5: boolean;
|
10 |
|
11 | crc32cGenerator: CRC32CValidatorGenerator;
|
12 |
|
13 | crc32cExpected?: string;
|
14 |
|
15 | md5Expected?: string;
|
16 |
|
17 | updateHashesOnly?: boolean;
|
18 | }
|
19 | declare class HashStreamValidator extends Transform {
|
20 | #private;
|
21 | readonly crc32cEnabled: boolean;
|
22 | readonly md5Enabled: boolean;
|
23 | readonly crc32cExpected: string | undefined;
|
24 | readonly md5Expected: string | undefined;
|
25 | readonly updateHashesOnly: boolean;
|
26 | constructor(options?: Partial<HashStreamValidatorOptions>);
|
27 | _flush(callback: (error?: Error | null | undefined) => void): void;
|
28 | _transform(chunk: Buffer, encoding: BufferEncoding, callback: (e?: Error) => void): void;
|
29 | test(hash: 'crc32c' | 'md5', sum: Buffer | string): boolean;
|
30 | }
|
31 | export { HashStreamValidator, HashStreamValidatorOptions };
|