Depends what you want to do but something like :

<cfset keylength = 10> <!---- length of key ----->
<cfset key ="">         <!--- the key "" to start ---->


<cfloop from=1 to=keylength index=idx>
        <!--- you might want to change this, to use a different set of charactors
if being used in a url for example--->
        <cfset chrindex = RandRange(65, 126)>
        <!---- build the key ----->
        <cfset key = key & Chr(chrindex)>
</cfloop>

<!--- output the key --->
<cfoutput>
        #key#
</cfoutput>


Justin MacCarthy

>-----Original Message-----
>From: listmb [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, January 02, 2001 12:50 PM
>To: CF-Talk
>Subject: Re[4]: Generating unique values
>
>
>Thanks this sounds like they are using a guid call to generate this.
>Is there some other algorihth i could use or ways I could do this?
>
>Thanks,
>WayGee
>
>Hello JustinMacCarthy,
>
>Tuesday, January 02, 2001, 6:15:41 AM, you wrote:
>
>J> But it doesn't create values which are not easy to guess.
>
>J> Two consecutive UUID will have similar values + 1
>
>
>J> Justin
>
>>>-----Original Message-----
>>>From: listmb [mailto:[EMAIL PROTECTED]]
>>>Sent: Sunday, December 31, 2000 10:01 PM
>>>To: CF-Talk
>>>Subject: Re[2]: Generating unique values
>>>
>>>
>>>Thanks Nick,
>>>
>>>That was just what I was looking for!
>>>
>>>Best,
>>>WayGee
>>>
>>>
>>>Hello Nick,
>>>
>>>Sunday, December 31, 2000, 4:00:40 PM, you wrote:
>>>
>>>NM> You can use the CreateUUID function.
>>>
>>>NM> It generates a Universally Unique ID. It does contain both
>>>letters and numbers.
>>>
>>>NM> At 03:58 PM 12/31/2000 -0500, you wrote:
>>>>>Hi,
>>>>>
>>>>>Being new to cold fusion (1 week),  can anyone let me know if there is
>>>>>a way to create unique random numbers or strings in cold fusion?
>>>>>It should not be iterative or easily guessed.
>>>>>
>>>>>
>>>>>This would help alot!
>>>>>
>>>>>--
>>>>>Best regards,
>>>>>WayGee                          mailto:[EMAIL PROTECTED]
>>>>>
>>>>>
>>>>>
>>>>>
>>>NM>
>>>
>J>
>
~~~~~~~~~~~~~ Paid Sponsorship ~~~~~~~~~~~~~
Get Your Own Dedicated Win2K Server!      Instant Activation for $99/month w/Free 
Setup from SoloServer      PIII600 / 128 MB RAM / 20 GB HD / 24/7/365 Tech Support     
 Visit SoloServer, https://secure.irides.com/clientsetup.cfm.

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to