Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How OpenUDID works

Do you know how OpenUDID generate unique device ID?
Is there any chance that 2 devices having the same OpenUDID value?

EDIT 1:

Will the OpenUDID change when the device is reset?

EDIT 2:

If collision is possible, is there any alternative for OpenUDID that could work better.

like image 328
Tuyen Nguyen Avatar asked Mar 27 '12 16:03

Tuyen Nguyen


4 Answers

If only there was a way to have a look at the source code...

// Next we try to use an alternative method which uses the host name, process ID, and a time stamp
// We then hash it with md5 to get 32 bytes, and then add 4 extra random bytes
// Collision is possible of course, but unlikely and suitable for most industry needs (e.g.. aggregate tracking)
like image 90
Stephen Darlington Avatar answered Oct 22 '22 12:10

Stephen Darlington


According to this OpenUDID works like this:

Technically, OpenUDID uses a mix of local app storage for cache and safeguarding, as well as inter-app storage (custom pasteboards on iOS). This means that the system is decentralized, neither controlled by Apple nor anyone else. The more OpenUDID is used, the more robust and prevalent and tamper proof it gets.

Other than that, the OpenUDID looks and feels the same as the native UDID, a 40 characters long hexadecimal string. For instance:

369416e16c373b617b2e4d151e01244c748c7b3e

I hope this helps

like image 23
raukodraug Avatar answered Oct 22 '22 13:10

raukodraug


It is essentially a 160bit random string. So there are 2^160 combinations. So it is very very unlikely to ever get two the same

like image 3
trapper Avatar answered Oct 22 '22 11:10

trapper


Then this really isn't suitable for apps that use the UDID as a login identifier.. If you have to restore your device then the UDID will be different whereas Apple's UDID is part of the actual phone and will persist restores.

This is really more like a cookie for advertisers to use .. it doesn't HAVE to be 100% accurate then, only mostly accurate.

like image 3
Lonnie Avatar answered Oct 22 '22 13:10

Lonnie