Skip to content

Commit 9e2f093

Browse files
committed
chore: add ts type again
1 parent d2fca54 commit 9e2f093

File tree

1 file changed

+11
-11
lines changed
  • infrastructure/w3id/src/utils

1 file changed

+11
-11
lines changed

infrastructure/w3id/src/utils/rand.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
* @returns {string}
66
*/
77

8-
export function generateRandomAlphaNum(length = 16): string {
9-
const chars =
10-
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
11-
let result = "";
12-
const charsLength = chars.length;
13-
const randomValues = new Uint32Array(length);
8+
export function generateRandomAlphaNum(length: number = 16): string {
9+
const chars =
10+
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
11+
let result = "";
12+
const charsLength = chars.length;
13+
const randomValues = new Uint32Array(length);
1414

15-
crypto.getRandomValues(randomValues);
15+
crypto.getRandomValues(randomValues);
1616

17-
for (let i = 0; i < length; i++) {
18-
result += chars.charAt(randomValues[i] % charsLength);
19-
}
17+
for (let i = 0; i < length; i++) {
18+
result += chars.charAt(randomValues[i] % charsLength);
19+
}
2020

21-
return result;
21+
return result;
2222
}

0 commit comments

Comments
 (0)