Created
March 30, 2017 10:52
-
-
Save volkanozcan2/d21221709f3596ed5beba3fef8694464 to your computer and use it in GitHub Desktop.
javascript:RandomString
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
function getRandomString(n) { | |
var n = n || 9; | |
var letters = '0123456789ABCÇDEFGĞHİIJKLMNOÖPRSŞTUÜVYZabcçdefgğhıijklmnoöprsştuüvyz'.split(''); | |
var returnString = ""; | |
for (var i = 0; i < n; i++) { | |
returnString += letters[~~(Math.random() * letters.length)]; | |
} | |
return returnString; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment