Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Generate a unique ID

by sundialsvc4 (Abbot)
on Nov 15, 2010 at 13:24 UTC ( #871475=note: print w/ replies, xml ) Need Help??


in reply to Generate a unique ID

I think you have three choices:

  1. Timestamps, if you know that all clocks are synchronized.
  2. Serially incrementing numbers, if you have a known interlocking mechanism.
  3. Pseudo-random numbers, such as UUIDs, which are, after all, designed for just this purpose.   (You can, as I have opined before, prepend a human-readable string to these, without compromising their randomness.)

Consider whether the “unique identifier” would benefit from having some “human readable” content, such as a timestamp would have ... whether the unique id needs to be “unique across systems” ... what your practical timing considerations are.


Comment on Re: Generate a unique ID

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://871475]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2015-07-07 15:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (90 votes), past polls