mirror of
https://github.com/AlecM33/Werewolf.git
synced 2025-12-26 15:57:50 +01:00
16 lines
379 B
JavaScript
16 lines
379 B
JavaScript
export const utility =
|
|
{
|
|
generateID() {
|
|
let code = "";
|
|
let charPool = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
|
for (let i = 0; i < 10; i++) {
|
|
code += charPool[this.getRandomInt(61)]
|
|
}
|
|
return code;
|
|
},
|
|
|
|
getRandomInt(max) {
|
|
return Math.floor(Math.random() * Math.floor(max));
|
|
}
|
|
};
|