Read the GUID and UID in general.
In most cases, if you use a database that will generate a unique identifier for you, then this unique identifier can be encoded in numbers and letters to shorten the total string.
http://en.wikipedia.org/wiki/Globally_unique_identifier
The shortening of the line is related to how you encode the value; it does not actually change it.
For example, the number 15 in base 10 uses two digits, in hexadecimal it uses one digit (f) in binary, it uses 4 (1111).
In the same way, you can use az, AZ, 0-9 and get base 62 for encoding numbers into strings using a much smaller number of digits than using base 10.
This is not the only approach, but (especially if you already have database rows), this is the easiest. You don't even need to pad to 11 if you really don't want to - but adding any number 0 to the beginning of the encoded line does not change its value.
Java even provides functions for this, although the maximum radius on them is 36:
http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html#toString%28int,%20int%29
source share