On 11/24/17 2:25 PM, Keith Medcalf wrote:
Actually a UUID or a GUID has a 100% certainty of a collision,  not just a possibility of a 
collision.  Just as all hash algorithms which take something and generate a shorter 
"hash" or "checksum" will always have collisions.  Without exception and as an 
absolute 100% certainty.  There is no way to avoid this mathematical certainty.

However, whether the absolute and unmitigatable certainty of a collision is of 
any import or not is an entirely different matter.

Absolutely incorrect, for a UID. Perhaps if you are talking about actual hashes, you can say that there are always multiple (at least potential) messages that will generate the same hash value (but for a good hash, the likelihood that one of them is sensible or even actually generated is minuscule). for a UID, while they are typically created by a hash of various information, including something that varies each time a given generator is used, what those inputs actually are is generally unimportant, but are mostly provided to help make the 'randomness' of the choice more 'random'. We are never really concerned with 'potential' collisions, only actual collisions.

One proof of the falsehood of your assertion is that we CAN fill a database with some data using UIDs, and we will almost certainly not get a collision, while you assertion we will.

Yes, there is a limit on how many entries we can generate before we will likely, or even certainly hit a collision, but if that number is significantly higher than the number of records we will generate (or even CAN generate), we can assume relative safety. With a 128 bit UID, the approximate point we need to worry about random collisions is the order of 2^64, I suspect that creating an SQLite database with 2^64 non-trivial records in a single table is likely going to have other issues besides unique key collisions.

--
Richard Damon

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

Reply via email to