Created
February 29, 2016 15:02
-
-
Save liuxiaojiu/fb0cbf9240218f3a4a35 to your computer and use it in GitHub Desktop.
生成36位的随机数
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 generateRandomAlphaNum(len) { | |
var rdmString = ""; | |
for (; rdmString.length < len; rdmString += Math.random().toString(36).substr(2)); | |
return rdmString.substr(0, len); | |
} | |
generateRandomAlphaNum(15) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment