mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-26 19:14:32 +02:00
13 lines
339 B
TypeScript
13 lines
339 B
TypeScript
// Function that generates a random gibberish string of length n
|
|
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
|
|
export function createRandomString(n: number): string {
|
|
let str = "";
|
|
|
|
for (let i = 0; i < n; ++i) {
|
|
str += chars.charAt(Math.floor(Math.random() * chars.length));
|
|
}
|
|
|
|
return str;
|
|
}
|