My apologies, the previous post got sent before it was finished, my browser loves to send posts while I'm typing.
What I was trying to convey is the UUID is represented by 32 characters and a few dashes. Each char is representing 4bits of the 128bit id (0000-1111, 0-F, 0-15). If you're trying to make IDs that are easier to type you'll obviously want to stick within the ASCII character range. Using a ([0-9][A-Z]) range would probably be your best bet. If you used 255 characters you could map from 00000000-11111111, 00-FF, 0-255, but I doubt you want your users typing odd ASCII chars in.
Your problem is going to arise from the fact that in the English language we only have A-Z (26) and 0-9 (10) characters giving you a total of 36 possible mappings (000000-110110, 0x00-0x36, 0-36). You'd obviously like to map from 000000-111111, 0x00-0x63, 0-63) since that gives you the full 6 bit range. You could achieve this by using a case sensitive set and one "extra" char ([a-z][A-Z][0-9][*]) giving you a total of 63 options. However for all you're effort you're only going to be able to reduce the key size to 22 chars (128/6=21.33333) from the original 22.
Just some random thoughts on the topic,
Tyler
|