List of utility methods to do UUID Create
String | generateUUID(String prefix) generate UUID return UUID.randomUUID().toString();
|
UUID | generateUuid(String seed) Generates a GUID using a seed. try { return UUID.nameUUIDFromBytes(seed.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { throw new RuntimeException(String.format("UnsupportedEncodingException: %f", e.getMessage())); |
String | generateUUIDFileName(String fileName) generate UUID File Name UUID uuid = UUID.randomUUID(); String str = fileName; System.out.println(str); str = uuid.toString() + "." + str.substring(str.lastIndexOf(".") + 1); return str; |
UUID | generateUUIDFrom(String uuidString) generate UUID From StringBuilder uuidFromString = new StringBuilder(uuidString); uuidFromString.insert(8, DELIMITER); uuidFromString.insert(13, DELIMITER); uuidFromString.insert(18, DELIMITER); uuidFromString.insert(23, DELIMITER); return UUID.fromString(uuidFromString.toString().toLowerCase()); |
UUID | generateUUIDFromString(String uuid) generate UUID From String return UUID.fromString(uuid);
|
String | generateUUIDName(String filename) generate UUID Name String ext = filename.substring(filename.indexOf(".") + 1); return UUID.randomUUID().toString() + "." + ext; |
String | generateUUIDRandom() generate UUID Random String uuid = UUID.randomUUID().toString(); uuid += "-" + generateShortRandom(); return uuid; |
String | generateUuidStringStatic() generate Uuid String Static while (true) { String uuid = UUID_BASE + Long.toHexString(System.currentTimeMillis()); if (!uuid.equals(previousUuid)) { previousUuid = uuid; return uuid; try { Thread.sleep(1); ... |
String | generatorToken() generator Token UUID uuid = UUID.randomUUID(); String token = uuid.toString(); token = token.toUpperCase(); token = token.replaceAll("-", ""); return token; |
String | generatorTransactionPath(String namespace) generator Transaction Path StringBuilder builder = new StringBuilder(); builder.append("/").append(namespace).append("/").append(generateStringUuid()); return builder.toString(); |