How OpenUDID works

Tuyen Nguyen picture Tuyen Nguyen · Mar 27, 2012 · Viewed 12.2k times · Source

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.

Answer

Stephen Darlington picture Stephen Darlington · Mar 27, 2012

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)