List of utility methods to do UUID Create
String | generateUuid() generate Uuid UUID uuid = UUID.randomUUID(); StringBuffer idcUuid = new StringBuffer(uuid.toString().toUpperCase()); while (idcUuid.length() < 36) { idcUuid.append("0"); return idcUuid.toString(); |
UUID | generateUUID() generate UUID UUID result = UUID.randomUUID(); char[] chars = result.toString().toCharArray(); if (chars[0] >= 'a' && chars[0] <= 'z') { return result; } else { Random r = new Random(); chars[0] = hexa.charAt(r.nextInt(hexan)); result = UUID.fromString(new String(chars)); ... |
String | generateUUID() generate UUID char[] uuid = new char[32]; char[] chars = UUID.randomUUID().toString().toCharArray(); for (int i = 0, j = 0; i < 32; j++) if (chars[j] != '-') uuid[i++] = chars[j]; return new String(uuid); |
String | generateUUID() Generate UUID. String random = UUID.randomUUID().toString(); random = random.replace("/", "_"); random = random.replace("=", "a"); random = random.replace("+", "f"); return random; |
String | generateUUID() generate UUID StringBuffer sb = new StringBuffer(); for (int i = 0; i < 8; i++) { sb.append(UUID.randomUUID().toString().split("-")[0]); sb.append(UUID.randomUUID().toString().split("-")[1]); sb.append(UUID.randomUUID().toString().split("-")[2]); sb.append(UUID.randomUUID().toString().split("-")[3]); sb.append(UUID.randomUUID().toString().split("-")[4]); return sb.toString(); |
String | generateUUID() Generate Samsung uuid. String uuid_prefix = "4a682b0b-0361-dbae-6155"; String uuid = String.valueOf(UUID.randomUUID()); String uuid_suffix = uuid.substring(uuid.lastIndexOf("-")); return uuid_prefix + uuid_suffix; |
String | generateUUID() generate UUID UUID uuid = UUID.randomUUID();
return uuid.toString();
|
String | generateUuid(boolean dash) Generate UUID String uuid = UUID.randomUUID().toString(); if (dash) { return uuid; return uuid.replaceAll("-", ""); |
String | generateUUID(int numchars) Generated a random UUID with the specified number of characters. Random r = new Random(); StringBuilder sb = new StringBuilder(numchars); for (int i = 0; i < numchars; i++) { int c = r.nextInt(36) + 97; if (c > 'z') c -= ('z' - '0' + 1); sb.append((char) c); return sb.toString(); |
String | generateUUID(Object o) generate UUID StringBuffer tmpBuffer = new StringBuffer(16); if (hexServerIP_ == null) { InetAddress localInetAddress = null; try { localInetAddress = InetAddress.getLocalHost(); } catch (java.net.UnknownHostException uhe) { uhe.printStackTrace(); return null; ... |