scott_flex wrote:
> Is there no function or object to generate a GUID, a true globally 
> unique identifier?

Just write your own--it's dirt simple.  FYI, GUIDs and UUIDs aren't 
actually guaranteed to be absolutely unique--however, given the number 
of random bits involved, a repeat is statistically highly unlikely to 
happen.

They're essentially just concatenated random bits,  although in some 
cases a few bits are derived from MAC addresses (per version 1 UUIDs, 
which you won't have to access to) or hashes of a URL (version 3 and 5 
UUIDs).

See:

   http://en.wikipedia.org/wiki/Globally_Unique_Identifier

   http://www.ietf.org/rfc/rfc4122.txt

If you need it to play with a server and you're worried about repeats 
enough to expend some developer cycles, a better use of your time is to 
hash the GUIDs that you're given on the server-side and do a quick 
search for a collision prior to creating a database entry.  This tactic 
also gets you around the possibility of malicious folk passing in faked 
GUIDs that they know may result in a collision.

Jim Cheng
effectiveUI


Reply via email to