tags:

views:

953

answers:

3
+1  Q: 

Valid UDIDs?

Duplicate: http://stackoverflow.com/questions/772858/validate-iphone-device-ids/774518#774518

Does anyone know what constitutes a valid iPhone UDID?

Context: I am working on some session code for a server that interacts with iPhones, and was going to use the iPhone's UDID as a unique identifier. However, I can't seem to find any resources on the range of valid UDIDs, and I want to know exactly what I can expect coming from an iPhone.

Clarification: I'm not asking about how to validate an iPhone UDID as a legitimate iPhone UDID, I'm trying to figure out the range of UDIDs. For example, in programming languages there are specs on what you can use to name your variables (starts with a letter, contains letters and numbers, etc.). I want the same sort of spec for the UDID.

+1  A: 

No, there is no way to do so. This question asks the same thing: Validate iPhone device Ids?

UPDATE: From what I've seen, the device ID is a 40 character hex string (0-9 and a-f). Apple's documentation for the deviceIdentifier property of UIDevice states:

A unique device identifier is a hash value composed from various hardware identifiers such as the device’s serial number. It is guaranteed to be unique for every device but cannot publically be tied to a user account. You can use it, for example, to store high scores for a game in a central server or to control access to registered products. The unique device identifier is sometimes referred to by its abbreviation UDID.

Martin Gordon
Sorry, that's not quite what I'm asking, let me update my question.
+2  A: 

It is a 40 character hex string. There is no spec or doc out there that specifies the layout to this string.

I'm not really sure how you can determine what is 'valid' since only Apple knows which UDID are real and which are false.

My best guess, given the various UDIDs that I've seen, they are 40 characters in length, consisting of alphanumeric characters. (a-f0-9)

Nick Presta
Wait... if it's a 40 character *hex* string, wouldn't that make the values be A-F0-9?
I meant a-f, sorry.
Nick Presta
A: 

Actually, the iphone simulator udid has dashes and is 36 hex characters long.

For example:

002ebf12-a125-5ddf-a739-67c3c5d20177

Though I have only seen actual iphone udid's with hex only chars and 40 long.

thesmart