<cfscript>
digits = arrayNew(1) ;
passwd = "" ;
/* fill passwd i digits long w/ random selection of number, uppercase, or
lowercase characters */
for (i=1; i le 8; i=i+1) {
digits[1] = chr(randRange(48, 57)) ;
digits[2] = chr(randRange(65, 90)) ;
digits[3] = chr(randRange(97, 122)) ;
passwd = passwd & digits[randRange(1, 3)] ;
}
<cfscript>
If you're not case sensitive feel free to remove digits[3] and change the
last randRange() to reflect it.
-----Original Message-----
From: Peter Benoit [mailto:[EMAIL PROTECTED]]
Sent: January 31, 2001 10:56
To: CF-Talk
Subject: Random letter/number value
Hi,
I'd like to produce a random letter/number value for a password field, could
be around 8 characters I suppose. Can I get help with this please?
Thanks,
Peter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists