My app uses a device's phone number to get meaningful information about the user's contacts. It runs on Android and iOS.
On a phone, I simply use the 10-digit (no country code) phone number as the user's unique identifier. This even works on the Android simulator (which has its own defunct number), though the iPhone simulator returns a blank number (I can easily ignore this case).
Now I got to testing on non-phone devices. While they still have contacts available, they no longer have a phone number. An easy approach would be to use the UDID in iOS and whatever the equivalent is in Android. However, I have 2 problems I need solving:
The UDID is not uniform. I need a 10 character key. Is there any way to hash n-characters into 10-characters, avoiding collisions? (I can live with very low probability collisions)
Even a bigger issue: I just read that Apple is blocking UDID access as of iOS 5. What shall I use in its stead, again, with the need to maintain a 10-character key?
Thanks for your time.