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