@Override public String create() { long timestamp = System.currentTimeMillis(); byte[] uuidBytes = new byte[9]; // Only use lower 6 bytes of the timestamp (this will suffice beyond the year 10000): putLong(uuidBytes, timestamp, 0, 6); // Sequence number adds 3 bytes: putLong(uuidBytes, getSequenceNumber(), 6, 3); return byteArrayToHex(uuidBytes); }
@Override public String create() { long timestamp = System.currentTimeMillis(); byte[] uuidBytes = new byte[9]; // Only use lower 6 bytes of the timestamp (this will suffice beyond the year 10000): putLong(uuidBytes, timestamp, 0, 6); // Sequence number adds 3 bytes: putLong(uuidBytes, getSequenceNumber(), 6, 3); return byteArrayToHex(uuidBytes); }