(length = 1024)
| 73 | } |
| 74 | |
| 75 | function generateRandomString(length = 1024) { |
| 76 | // Choose your desired character set |
| 77 | const characters = |
| 78 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; |
| 79 | const charactersLength = characters.length; |
| 80 | |
| 81 | let result = ""; |
| 82 | for (let i = 0; i < length; i++) { |
| 83 | result += characters.charAt(Math.floor(Math.random() * charactersLength)); |
| 84 | } |
| 85 | |
| 86 | return result; |
| 87 | } |