-
Notifications
You must be signed in to change notification settings - Fork 138
/
hashes.d.ts
63 lines (52 loc) · 1.43 KB
/
hashes.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
declare module 'jshashes' {
class HashesClass {
/**
* Hexadecimal hash encoding from string.
*/
hex(input: string): string;
/**
* Base64 hash encoding from string.
*/
b64(input: string): string;
/**
* Custom hash algorithm values encoding.
*/
any(input: string, encoding: string): string;
/**
* Hexadecimal hash with HMAC salt key.
*/
hex_hmac(key: string, input: string): string;
/**
* Custom hash values encoding with HMAC salt key support.
*/
b64_hmac(key: string, input: string): string;
/**
* Custom hash values encoding with HMAC salt key support.
*/
any_hmac(key: string, input: string, encoding: string): string;
/**
* Simple self-test to see if working.
*/
vm_test(): this;
/**
* Enable/disable uppercase hexadecimal returned string.
*/
setUpperCase(isEnabled: boolean): this;
/**
* Defines a custom base64 pad string. Default is '=' according with the RFC standard.
*/
setPad(pad: string): this;
/**
* Enable/disable UTF-8 character encoding.
*/
setUTF8(isEnabled: boolean): this;
}
namespace Hashes {
export class MD5 extends HashesClass { }
export class SHA1 extends HashesClass { }
export class SHA256 extends HashesClass { }
export class SHA512 extends HashesClass { }
export class RMD160 extends HashesClass { }
}
export = Hashes;
}