-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
39 lines (36 loc) · 959 Bytes
/
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
36
37
38
39
declare namespace ripemdRegex {
interface Options {
/**
Only match an exact string. By default, it matches any RIPEMD hashes in a string. Useful with `RegExp#test()` to check if a string is a RIPEMD hash.
@default false
*/
readonly exact?: boolean;
}
/**
Available RIPEMD versions.
*/
type Version = 128 | 160 | 256 | 320
}
declare const ripemdRegex: {
/**
Returns a regex for matching specific RIPEMD version hashes.
@example
```
import ripemdRegex = require('ripemd-regex')
ripemdRegex.version(128, {exact: true}).test('3edc724c455361be0a366c838e7d2434');
//=> true
```
*/
version: (version: ripemdRegex.Version, options?: ripemdRegex.Options) => RegExp;
/**
Returns a regex for matching RIPEMD hashes.
@example
```
import ripemdRegex = require('ripemd-regex')
ripemdRegex().test('nodejsrocks 744fdac358014a96aedd7e87150c5a5e04a13001');
//=> true
```
*/
(options?: ripemdRegex.Options): RegExp;
}
export = ripemdRegex