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