Correct me if I'm wrong but won't hashing the same string produce the
same hash?? (which is the whole point of hashing a string to begin with) This
means if you can't truncate a unique identifier and be sure of uniqueness (which
you can't) hashing it or not hashing it will make no
difference
-
James
--------Original Message-----
From: Vaughan Allan [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 11, 2003 4:24 PM
To: CFAussie Mailing List
Subject: [cfaussie] RE: a long shot...
Further to this - if you *REALLY* wanted to truncate a UUID and have some sort of uniqueness, hash() it first.
e.g.
<cfscript>
uuid = CreateUUID();
myhash = hash(uuid);
myid = left(myhash,16);
writeoutput(myid);
// or a shorter version:
// writeoutput(left(hash(createuuid()),16));
</cfscript>
Regards,
Vaughan.
"Darren Tracey" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]11/09/2003 04:02 PM
Please respond to
"CFAussie Mailing List" <[EMAIL PROTECTED]>
To"CFAussie Mailing List" <[EMAIL PROTECTED]> cc Subject[cfaussie] RE: a long shot...
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, 11 September 2003 2:36 PM
To: CFAussie Mailing List
Subject: [cfaussie] a long shot...
The field is of datatype varchar (16), so if I was to use createUUID() to arrive at the value, would i be assured that the final 16 characters of the UUID generated by CF is going to be unique?
You should _not_ assume that one end of a UUID value generated by CF will be unique.
I came across this little oddity at my last job, so this info is all pre CFMX (CF 5).
If you make a series of UUID value on a windows box, and another set on a Solaris box (with the exact same cf code), the first dozen or so characters will be changing while the last characters will remain relatively static in only one of the 2 series, and in the other series the first half of the characters will be static and the last half of the characters will be changing. I can't recall which OS was which way, but I do know they were the opposite of each other.
This may have all changed in the change to MX, but I'm not in a position to try it out anymore.
The lesson from this, don't assume a truncated portion of a UUID will be unique.
Regards
Darren Tracey
---
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/
****************************************************************************
If this communication is not intended for you and you are not an authorised
recipient of this email you are prohibited by law from dealing with or
relying on the email or any file attachments. This prohibition includes
reading, printing, copying, re-transmitting, disseminating, storing or in
any other way dealing or acting in reliance on the information. If you
have received this email in error, we request you contact ABN AMRO Morgans
Limited immediately by returning the email to [EMAIL PROTECTED]
and destroy the original. We will refund any reasonable costs associated
with notifying ABN AMRO Morgans. This email is confidential and may contain
privileged client information. ABN AMRO Morgans has taken reasonable steps
to ensure the accuracy and integrity of all its communications, including
electronic communications, but accepts no liability for materials
transmitted. Materials may also be transmitted without the knowledge of ABN
AMRO Morgans. ABN AMRO Morgans Limited its directors and employees do not
accept liability for the results of any actions taken or not on the basis
of the information in this report. ABN AMRO Morgans Limited and its
associates hold or may hold securities in the companies/trusts mentioned
herein. Any recommendation is made on the basis of our research of the
investment and may not suit the specific requirements of clients.
Assessments of suitability to an individual's portfolio can only be made
after an examination of the particular client's investments, financial
circumstances and requirements.
****************************************************************************
--- 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/
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/
