UUID libraries generate 32-character UUIDs.
I want to generate 8-character only UUIDs, is it possible?
As @Cephalopod stated it isn't possible but you can shorten a UUID to 22 characters
public static String encodeUUIDBase64(UUID uuid) {
ByteBuffer bb = ByteBuffer.wrap(new byte[16]);
bb.putLong(uuid.getMostSignificantBits());
bb.putLong(uuid.getLeastSignificantBits());
return StringUtils.trimTrailingCharacter(BaseEncoding.base64Url().encode(bb.array()), '=');
}