Skip to content

Instantly share code, notes, and snippets.

@liuxiaojiu
Created February 29, 2016 15:02
Show Gist options
  • Save liuxiaojiu/fb0cbf9240218f3a4a35 to your computer and use it in GitHub Desktop.
Save liuxiaojiu/fb0cbf9240218f3a4a35 to your computer and use it in GitHub Desktop.
生成36位的随机数
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