Last active
March 5, 2024 15:30
-
-
Save tolotrasmile/9fb521e83dd9f6a6267b3e617d03dfae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Generate random string with specified length | |
* Each generated letter will be from A to Z | |
* | |
* 65 = A | |
* 90 = Z | |
* A-Z = 25 | |
* | |
* @param length | |
*/ | |
function randomString(length: number): string { | |
return Array.from({ length }, () => String.fromCharCode(25 * Math.random() + 65)).join('') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment