Is Google Drive File ID Unique globally?

人盡茶涼 提交于 2020-01-03 17:15:11

问题


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'


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/19686430/is-google-drive-file-id-unique-globally

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!