On 1/24/11 8:36 AM, "Simon Slavin" <slav...@bigfraud.org> wrote:

> 
> On 24 Jan 2011, at 4:21pm, Duquette, William H (318K) wrote:
> 
>> A question on using randomblob(16) to generate UUIDs, as the SQLite docs
>> suggest: what assurance do you have that the UUID really is universally
>> unique?  It's a pseudo-random number, and you can replicate a stream of
>> pseudo-random numbers by setting the seed appropriately.  Is randomblob()
>> doing some kind of magic in its seeding of the random number stream?
> 
> Your assurance is only statistical.  Version 4 UUIDs have 30 4-bit higits and
> one 2-bit higit.  That gives you
> 
> (30 * 4) + 2 == 122
> 
> bits of randomness, which is about 5e36 different numbers.  You can work out
> yourself how fast people would have to choose random numbers to stand a chance
> of one duplication in ten years.

Provided that your starting seed is chosen in a
sufficiently random way, which evidently it is.
A bad choice of starting seed could bring the
whole thing crashing to the ground.


> 
> 
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

--
Will Duquette -- william.h.duque...@jpl.nasa.gov
Athena Development Lead -- Jet Propulsion Laboratory
"It's amazing what you can do with the right tools."


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to