Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS: UDID is upper case

Tags:

ios

udid

I know about iOS device UDID and that are case-sensitive. But I have a query, my client sent me all upper case in UDID characters. I have never seen any upper case letters in UDID's. I don't find any document that says UDID can have upper case letters consists. I need to create a right build to them. Could someone advise, what should I ask my client now? I can't say them, UDID is incorrect. Can I ask them to make sure the case-sensitive and send me back? Also, Can UDID have upper and lower case combination in letters?

like image 953
Daisy Avatar asked May 04 '26 01:05

Daisy


2 Answers

You can just convert it back to lowercase safely.

UDIDs are the output of a SHA1 function, and is represented as is typical as a string of hexadecimal characters. You don't need to worry about "a" meaning something different than "A", it's just different formatting for the same values. Just change the capitalization to the format you desire (lowercase, in this case), and not worry about it, unless you have other reason to believe the client sent you the wrong thing (wrong length, and characters other than 0-9, a-f/A-F would both warrant a raised eyebrow).

like image 151
Kitsune Avatar answered May 05 '26 15:05

Kitsune


The spec says:

"hexadecimal values "a" through "f" are output as lower case characters and are case insensitive on input."

Which means that while you can read/parse either case, they should be output as lower case.

Upper case UUIDs come from a well known bug in Apples libraries where they output upper case UUIDs, so your clients data was probably generated with Objective-C, or Swift.

What this means, is that you should not be getting upper case UUIDs from your client, but I suspect you will have a hard time getting them to change it, because in my experience, apple developers tend to resist doing it right.

The good news is that you can parse the UUIDs like that, and when they get written out in whatever system you are using, they will be lower case (as long as you are not writing in Swift). If you are using the IDs as strings, then the case doesn't matter, but I'd still correct them. What I would do in your case, if your client won't budge, is add protection against crappy Swift output, so you store them properly.

like image 44
Brill Pappin Avatar answered May 05 '26 14:05

Brill Pappin