The following should do what you want.

<!--- init password --->
<cfset password="">
<!--- Set maxlen for password --->
<cfset pwdlen=8>
<!--- Set number radix. 36 = 0...10 plus a...z (10 + 26) --->
<cfset radix=36>
<cfloop from=1 to=#pwdlen# index=i>
        <cfset password=password & FormatBaseN(RandRange(1,radix),radix)>
</cfloop>


Steve

> -----Original Message-----
> From: Peter Benoit [mailto:[EMAIL PROTECTED]]
> Sent: 31 January 2001 15: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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to