1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | declare namespace createHash {
|
13 | type TypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array;
|
14 |
|
15 | interface HashAlgorithm {
|
16 | digest(target: encoding): string;
|
17 | digest(): Buffer;
|
18 |
|
19 | update(data: string | Buffer | TypedArray | DataView, encoding?: string): this;
|
20 | write(data: string | Buffer | TypedArray | DataView, encoding?: string): this;
|
21 |
|
22 | end(): void;
|
23 | read(): void;
|
24 | }
|
25 |
|
26 | type encoding = 'utf8' | 'hex' | 'base64';
|
27 | type algorithm =
|
28 | | 'md5'
|
29 | | 'rmd160'
|
30 | | 'ripemd160'
|
31 | | 'sha'
|
32 | | 'sha1'
|
33 | | 'sha224'
|
34 | | 'sha256'
|
35 | | 'sha384'
|
36 | | 'sha512';
|
37 | }
|
38 |
|
39 | declare function createHash(algorithm: createHash.algorithm, options?: any): createHash.HashAlgorithm;
|
40 |
|
41 | export = createHash;
|