1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-21 22:09:36 +02:00
AdventureLog/src/lib/index.ts

13 lines
399 B
TypeScript
Raw Normal View History

2024-03-29 21:41:22 +00:00
// place files you want to import through the `$lib` alias in this folder.
export function generateRandomString() {
2024-04-02 22:02:20 +00:00
let randomString = "";
const digits =
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
2024-04-02 22:02:20 +00:00
for (let i = 0; i < 10; i++) {
const randomIndex = Math.floor(Math.random() * digits.length);
randomString += digits[randomIndex];
}
return randomString;
}