@Test(timeout = 10) public void testCnameGeneratorSpeed() { CnameGenerator.generateCname(); }
public static String generateCname() { UUID uuid = UUID.randomUUID(); long leastSignificantBits = uuid.getLeastSignificantBits(); long mostSignificantBits = uuid.getMostSignificantBits(); ByteBuffer buffer = ByteBuffer.allocate(16); buffer.putLong(leastSignificantBits).putLong(mostSignificantBits); buffer.flip(); byte[] data = new byte[12]; buffer.get(data, 0, 12); return DatatypeConverter.printBase64Binary(data); }
CnameGenerator { public static String generateCname() { UUID uuid = UUID.randomUUID(); long leastSignificantBits = uuid.getLeastSignificantBits(); long mostSignificantBits = uuid.getMostSignificantBits(); ByteBuffer buffer = ByteBuffer.allocate(16); buffer.putLong(leastSignificantBits).putLong(mostSignificantBits); buffer.flip(); byte[] data = new byte[12]; buffer.get(data, 0, 12); return DatatypeConverter.printBase64Binary(data); } }
CnameGenerator { public static String generateCname() { UUID uuid = UUID.randomUUID(); long leastSignificantBits = uuid.getLeastSignificantBits(); long mostSignificantBits = uuid.getMostSignificantBits(); ByteBuffer buffer = ByteBuffer.allocate(16); buffer.putLong(leastSignificantBits).putLong(mostSignificantBits); buffer.flip(); byte[] data = new byte[12]; buffer.get(data, 0, 12); return DatatypeConverter.printBase64Binary(data); }  }
CnameGenerator { public static String generateCname() { UUID uuid = UUID.randomUUID(); long leastSignificantBits = uuid.getLeastSignificantBits(); long mostSignificantBits = uuid.getMostSignificantBits(); ByteBuffer buffer = ByteBuffer.allocate(16); buffer.putLong(leastSignificantBits).putLong(mostSignificantBits); buffer.flip(); byte[] data = new byte[12]; buffer.get(data, 0, 12); return DatatypeConverter.printBase64Binary(data); }  static String generateCname(); }
CnameGenerator { public static String generateCname() { UUID uuid = UUID.randomUUID(); long leastSignificantBits = uuid.getLeastSignificantBits(); long mostSignificantBits = uuid.getMostSignificantBits(); ByteBuffer buffer = ByteBuffer.allocate(16); buffer.putLong(leastSignificantBits).putLong(mostSignificantBits); buffer.flip(); byte[] data = new byte[12]; buffer.get(data, 0, 12); return DatatypeConverter.printBase64Binary(data); }  static String generateCname();  }