I mucked around and came up with this:
 
<!--- For any given millisecond, about a 1 in 16,777,216 chance of a duplicate UUID
  About the best we can do in 16 characters --->
 
<cffunction returntype="string" name="sortaUUID">
 
 <!--- Make sure we're the only ones on the server using this particular timestamp --->
 <cflock type="exclusive" timeout="1">
 
  <cfscript>
  
   ts = ((now() + 0) * 10000000) & "";  // now() + 0 gives timestamp with 12 significant digits in CFMX
   tsl = left(ts, 6); tsh = right(ts, 6); // have to break in half for formatBaseN() to handle
   writeOutput(ucase(formatBaseN(tsl, 16) & formatBaseN(tsh, 16)) & left(hash(createUuid()), 6));
   
  </cfscript>
 
 </cflock>
 
</cffunction>
 
<cfoutput>#sortaUUID()#</cfoutput>
 
 
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]...
This is a long shot but worth asking... ---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to