Java tutorial
//package com.java2s; //License from project: LGPL import java.util.UUID; public class Main { public static final String BASE_UUID_START = "0000"; public static final String BASE_UUID_END = "-0000-1000-8000-00805f9b34fb"; public static String uuidToString(UUID uuid) { String uuidString = uuid.toString(); if (uuidString.startsWith(BASE_UUID_START) && uuidString.endsWith(BASE_UUID_END)) { return uuidString.substring(4, 8); } return uuidString; } }