Created
May 8, 2018 18:28
-
-
Save celestora/5cba486bfac1ba282b79bc369b20afbb 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
String.__proto__.random = function str_rand(length) { | |
let string = ''; | |
for (let i = 1; i <= length; i++) { | |
string += String.fromCharCode(Math.ceil(Math.random() * (122 - 48) ) + 48); | |
} | |
return string; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment