On Fri, 18 Jan 2013 20:50:37 -0800, Knute Johnson
<> wrote, quoted or indirectly quoted someone
who said :
>
>Below is what I ended up with. I'm curious about the UUID. How do you
>create a time based UUID? And does it have less granularity that
>currentTimeMillis?
there are specified formulas for creating UUIDs. I think one way of
rapidly generating them would be to use System.currentTimeMillis for
the high 64 bits and System.nanotime for the lower 64 bits, but I
suspect that would not be considered kosher.
Another would be to use SecureRandom to generate 16 bytes, though that
probably is not as unique as you might hope.
a UUID is not just 128 bits. It has embedded fields that tell you how
it was generated.
--
Roedy Green Canadian Mind Products
http://mindprod.com
The first 90% of the code accounts for the first 90% of the development time.
The remaining 10% of the code accounts for the other 90% of the development
time.
~ Tom Cargill Ninety-ninety Law