11
common/resources/client/utils/string/random-string.ts
Executable file
11
common/resources/client/utils/string/random-string.ts
Executable file
@@ -0,0 +1,11 @@
|
||||
export function randomString(length: number = 36) {
|
||||
let random = '';
|
||||
const possible =
|
||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
|
||||
for (let i = 0; i < length; i += 1) {
|
||||
random += possible.charAt(Math.floor(Math.random() * possible.length));
|
||||
}
|
||||
|
||||
return random;
|
||||
}
|
||||
Reference in New Issue
Block a user