|
| 1 | +/// <reference types="node" /> |
| 2 | + |
| 3 | +/** |
| 4 | + * Generate ssdeep hash asynchronously. |
| 5 | + * @param contents The data to hash. |
| 6 | + * @returns A promise to be resolved with the resulting hash. |
| 7 | + * @throws {TypeError} When the input is malformed. |
| 8 | + */ |
| 9 | +export declare function hash(contents: string | Buffer) : Promise<string>; |
| 10 | + |
| 11 | +/** |
| 12 | + * Generate ssdeep hash synchronously. |
| 13 | + * @param contents The data to hash. |
| 14 | + * @returns The resulting hash. |
| 15 | + * @throws {TypeError} When the input is malformed. |
| 16 | + */ |
| 17 | +export declare function hashSync(contents: string | Buffer) : string; |
| 18 | + |
| 19 | +/** |
| 20 | + * Compare ssdeep hashes asynchronously. |
| 21 | + * @param hash1 The first hash to compare. |
| 22 | + * @param hash2 The second hash to compare. |
| 23 | + * @returns A promise to be resolved with the similarity score for the input hashes, between 0-100. |
| 24 | + * @throws {TypeError} When the hashes are malformed. |
| 25 | + */ |
| 26 | +export declare function compare(hash1: string, hash2: string): Promise<number>; |
| 27 | + |
| 28 | +/** |
| 29 | + * Compare ssdeep hashes synchronously. |
| 30 | + * @param hash1 The first hash to compare. |
| 31 | + * @param hash2 The second hash to compare. |
| 32 | + * @returns The similarity score for the input hashes, between 0-100. |
| 33 | + * @throws {TypeError} When the hashes are malformed. |
| 34 | + */ |
| 35 | +export declare function compareSync(hash1: string, hash2: string): number; |
0 commit comments