Question

Is Google Drive File ID is unique across globe. Is there chance that UUID generated using NSUUID class will be same as Google drive File ID?
FYI:This is not duplicate of 'Are google docs/drive resource_id's globally unique'

Was it helpful?

Solution

The way we generate IDs are quite different than UUID generation and the canonical form of Drive generated IDs differ from v1/2/3/4/5 UUIDs. It's not possible you will see a collision.

OTHER TIPS

I would bet a great deal of money that Google does not check to ensure that its UUIDs are unique. And NSUUID most certainly doesn't check against all Google UUIDs.

However, the chances of a collision are absurdly small. If you generate 100k UUIDs, the chances of any two being the same are less than winning the Powerball jackpot 4 drawings in a row. If Google generates 10,000 UUIDs for every man, woman, and child alive, the chances of a collision are about the same as winning 3 drawings in a row. If everyone alive today got a UUID for everyone else alive today, the odds of a collision are about the odds of winning 2.285 drawings in a row (yeah, yeah, fractions of a discrete event, deal with it).

In short, you're more likely to have Dennis Ritchie come back from the dead and slap you silly for caring about UUID collisions than to actually see a collision. Don't worry about them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top