Created
May 28, 2012 23:01
-
-
Save boycaught/2821561 to your computer and use it in GitHub Desktop.
Generate random alphanumirc string of any length
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
<cfscript> | |
function generateRandomAlphaNumString(size) { | |
var _t = []; | |
for (i=1; i<=arguments.size; i++) { | |
if (randrange(1,2) eq 2) {_t[i]=chr(randrange(65,90));} | |
else if (randrange(1,2) eq 2) {_t[i]=chr(randrange(97,122));} | |
else {_t[i]=chr(randrange(48,57));} | |
} | |
return arraytolist(_t,''); | |
} | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment