The UUID provides (almost) 128 bits of uniqueness. You can shorten it to 16 binary bytes or 22 characters with base64 encoding. I would not recommend deleting any part of the UUID, otherwise it just makes no sense. UUIDs have been designed so that all 128 bits make sense. If you want less than this, you should use a different scheme.
For example, if you can guarantee that only UUIDs of version 4 are used, you can take only the first 32 bits or only the last 32 bits. You lose uniqueness, but you have pretty random numbers. Just avoid the bit that is fixed (version and version).
But if you cannot guarantee this, you will have real problems. For UUID version 1, the first bits will not be unique to UUIDs generated on the same day, and the last bits will not be unique to UUIDs generated on the same system. Even if you are a CRC UUID, it is not guaranteed that you will have 16 or 32 bits of uniqueness.
In this case, just use a different scheme. Create a 32-bit random number using the system random number generator and use this as your unique identifier. Do not rely on the UUID if you intend to remove its length.
Juliano
source share