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.

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

Reply via email to