Skip to content

Commit 78b84eb

Browse files
🤖 dprint fmt
1 parent 7739d25 commit 78b84eb

File tree

2 files changed

+166
-168
lines changed

2 files changed

+166
-168
lines changed

types/js-md5/index.d.ts

Lines changed: 166 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -1,170 +1,170 @@
11
declare namespace md5 {
2-
type Message = string | number[] | ArrayBuffer | Uint8Array;
3-
4-
interface Hasher {
5-
/**
6-
* Update hash
7-
*
8-
* @param message The message you want to hash.
9-
*/
10-
update(message: Message): Hasher;
11-
12-
/**
13-
* Return hash in hex string.
14-
*/
15-
hex(): string;
16-
17-
/**
18-
* Return hash in hex string.
19-
*/
20-
toString(): string;
21-
22-
/**
23-
* Return hash in ArrayBuffer.
24-
*/
25-
arrayBuffer(): ArrayBuffer;
26-
27-
/**
28-
* Return hash in integer array.
29-
*/
30-
digest(): number[];
31-
32-
/**
33-
* Return hash in integer array.
34-
*/
35-
array(): number[];
36-
37-
/**
38-
* Return hash in base64 string.
39-
*/
40-
base64(): string;
41-
}
42-
43-
interface Hmac {
44-
/**
45-
* Computes a Hash-based message authentication code (HMAC) using a secret key
46-
*
47-
* @param secretKey The Secret Key
48-
* @param message The message you want to hash.
49-
*/
50-
(secretKey: Message, message: Message): string;
51-
52-
/**
53-
* Create a hash object using a secret key.
54-
*
55-
* @param secretKey The Secret Key
56-
*/
57-
create(secretKey: Message): Hasher;
58-
59-
/**
60-
* Create a hash object and hash message using a secret key
61-
*
62-
* @param secretKey The Secret Key
63-
* @param message The message you want to hash.
64-
*/
65-
update(secretKey: Message, message: Message): Hasher;
66-
67-
/**
68-
* Return hash in hex string.
69-
*
70-
* @param secretKey The Secret Key
71-
* @param message The message you want to hash.
72-
*/
73-
hex(secretKey: Message, message: Message): string;
74-
75-
/**
76-
* Return hash in ArrayBuffer.
77-
*
78-
* @param secretKey The Secret Key
79-
* @param message The message you want to hash.
80-
*/
81-
arrayBuffer(secretKey: Message, message: Message): ArrayBuffer;
82-
83-
/**
84-
* Return hash in integer array.
85-
*
86-
* @param secretKey The Secret Key
87-
* @param message The message you want to hash.
88-
*/
89-
digest(secretKey: Message, message: Message): number[];
90-
91-
/**
92-
* Return hash in integer array.
93-
*
94-
* @param secretKey The Secret Key
95-
* @param message The message you want to hash.
96-
*/
97-
array(secretKey: Message, message: Message): number[];
98-
99-
/**
100-
* Return hash in base64 string.
101-
*
102-
* @param secretKey The Secret Key
103-
* @param message The message you want to hash.
104-
*/
105-
base64(secretKey: Message, message: Message): string;
106-
}
107-
108-
interface Hash {
109-
/**
110-
* Hash and return hex string.
111-
*
112-
* @param message The message you want to hash.
113-
*/
114-
(message: Message): string;
115-
116-
/**
117-
* Create a hash object.
118-
*/
119-
create(): Hasher;
120-
121-
/**
122-
* Create a hash object and hash message.
123-
*
124-
* @param message The message you want to hash.
125-
*/
126-
update(message: Message): Hasher;
127-
128-
/**
129-
* Return hash in hex string.
130-
*
131-
* @param message The message you want to hash.
132-
*/
133-
hex(message: Message): string;
134-
135-
/**
136-
* Return hash in ArrayBuffer.
137-
*
138-
* @param message The message you want to hash.
139-
*/
140-
arrayBuffer(message: Message): ArrayBuffer;
141-
142-
/**
143-
* Return hash in integer array.
144-
*
145-
* @param message The message you want to hash.
146-
*/
147-
digest(message: Message): number[];
148-
149-
/**
150-
* Return hash in integer array.
151-
*
152-
* @param message The message you want to hash.
153-
*/
154-
array(message: Message): number[];
155-
156-
/**
157-
* Return hash in base64 string.
158-
*
159-
* @param message The message you want to hash.
160-
*/
161-
base64(message: Message): string;
162-
163-
/**
164-
* HMAC interface
165-
*/
166-
hmac: Hmac;
167-
}
2+
type Message = string | number[] | ArrayBuffer | Uint8Array;
3+
4+
interface Hasher {
5+
/**
6+
* Update hash
7+
*
8+
* @param message The message you want to hash.
9+
*/
10+
update(message: Message): Hasher;
11+
12+
/**
13+
* Return hash in hex string.
14+
*/
15+
hex(): string;
16+
17+
/**
18+
* Return hash in hex string.
19+
*/
20+
toString(): string;
21+
22+
/**
23+
* Return hash in ArrayBuffer.
24+
*/
25+
arrayBuffer(): ArrayBuffer;
26+
27+
/**
28+
* Return hash in integer array.
29+
*/
30+
digest(): number[];
31+
32+
/**
33+
* Return hash in integer array.
34+
*/
35+
array(): number[];
36+
37+
/**
38+
* Return hash in base64 string.
39+
*/
40+
base64(): string;
41+
}
42+
43+
interface Hmac {
44+
/**
45+
* Computes a Hash-based message authentication code (HMAC) using a secret key
46+
*
47+
* @param secretKey The Secret Key
48+
* @param message The message you want to hash.
49+
*/
50+
(secretKey: Message, message: Message): string;
51+
52+
/**
53+
* Create a hash object using a secret key.
54+
*
55+
* @param secretKey The Secret Key
56+
*/
57+
create(secretKey: Message): Hasher;
58+
59+
/**
60+
* Create a hash object and hash message using a secret key
61+
*
62+
* @param secretKey The Secret Key
63+
* @param message The message you want to hash.
64+
*/
65+
update(secretKey: Message, message: Message): Hasher;
66+
67+
/**
68+
* Return hash in hex string.
69+
*
70+
* @param secretKey The Secret Key
71+
* @param message The message you want to hash.
72+
*/
73+
hex(secretKey: Message, message: Message): string;
74+
75+
/**
76+
* Return hash in ArrayBuffer.
77+
*
78+
* @param secretKey The Secret Key
79+
* @param message The message you want to hash.
80+
*/
81+
arrayBuffer(secretKey: Message, message: Message): ArrayBuffer;
82+
83+
/**
84+
* Return hash in integer array.
85+
*
86+
* @param secretKey The Secret Key
87+
* @param message The message you want to hash.
88+
*/
89+
digest(secretKey: Message, message: Message): number[];
90+
91+
/**
92+
* Return hash in integer array.
93+
*
94+
* @param secretKey The Secret Key
95+
* @param message The message you want to hash.
96+
*/
97+
array(secretKey: Message, message: Message): number[];
98+
99+
/**
100+
* Return hash in base64 string.
101+
*
102+
* @param secretKey The Secret Key
103+
* @param message The message you want to hash.
104+
*/
105+
base64(secretKey: Message, message: Message): string;
106+
}
107+
108+
interface Hash {
109+
/**
110+
* Hash and return hex string.
111+
*
112+
* @param message The message you want to hash.
113+
*/
114+
(message: Message): string;
115+
116+
/**
117+
* Create a hash object.
118+
*/
119+
create(): Hasher;
120+
121+
/**
122+
* Create a hash object and hash message.
123+
*
124+
* @param message The message you want to hash.
125+
*/
126+
update(message: Message): Hasher;
127+
128+
/**
129+
* Return hash in hex string.
130+
*
131+
* @param message The message you want to hash.
132+
*/
133+
hex(message: Message): string;
134+
135+
/**
136+
* Return hash in ArrayBuffer.
137+
*
138+
* @param message The message you want to hash.
139+
*/
140+
arrayBuffer(message: Message): ArrayBuffer;
141+
142+
/**
143+
* Return hash in integer array.
144+
*
145+
* @param message The message you want to hash.
146+
*/
147+
digest(message: Message): number[];
148+
149+
/**
150+
* Return hash in integer array.
151+
*
152+
* @param message The message you want to hash.
153+
*/
154+
array(message: Message): number[];
155+
156+
/**
157+
* Return hash in base64 string.
158+
*
159+
* @param message The message you want to hash.
160+
*/
161+
base64(message: Message): string;
162+
163+
/**
164+
* HMAC interface
165+
*/
166+
hmac: Hmac;
167+
}
168168
}
169169

170170
declare const md5: md5.Hash;

types/js-md5/js-md5-tests.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ arr = hash1.array();
2222
// $ExpectType ArrayBuffer
2323
buf = hash1.arrayBuffer();
2424

25-
2625
// $ExpectType Hasher
2726
const hash2 = md5.update("The quick brown fox jumps over the lazy dog");
2827
// $ExpectType string
@@ -36,7 +35,6 @@ arr = hash2.array();
3635
// $ExpectType ArrayBuffer
3736
buf = hash2.arrayBuffer();
3837

39-
4038
// $ExpectType string
4139
str = md5([]);
4240
// $ExpectType string

0 commit comments

Comments
 (0)