UDID
UDID is an acronym for Unique Device ID. This UDID is actually a feature of Apple iDevices. It is basically a unique id for a single device that is being fetched by Apple servers every time a user tries to activate the device using iCloud or Setup app. This ID is also used by iTunes to detect the phone or to communicate with it while restoring the iPSW firmware. This unique ID cannot be changed by the user nor Apple, but changing the motherboard will also change this ID.
Presentation Form
This Unique ID is created from 40 letters and numbers. It is not written on the iDevice cover as the IMEI is, but it can be retrieved by iTunes in normal mode.
Usage
Apple usually uses this ID to assign Apple ID and iCloud ID to the device. This also holds the Find My iPhone activation status.
Calculation
The UDID is being calculated like this:
For the Verizon iPhone 4 and newer ones use:
UDID = SHA1(serial + ECID + wifiMac + bluetoothMac)
All other devices use:
UDID = SHA1(serial + IMEI + wifiMac + bluetoothMac)