Java tutorial
//package com.java2s; import java.util.UUID; public class Main { public static final long leastSigBits = 0x800000805f9b34fbL; public static String toUuid128(long assignedNumber) { return toUuid(assignedNumber).toString(); } public static UUID toUuid(String uuidString) { return UUID.fromString(uuidString); } public static UUID toUuid(long assignedNumber) { return new UUID((assignedNumber << 32) | 0x1000, leastSigBits); } }