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