Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- long getUniqueID()
- {
- long timestamp = System.currentTimeMillis();
- long random = some random long
- ...
- return id;
- }
- return java.util.UUID.randomUUID().getLeastSignificantBits();
- public class UniqueID {
- static long current= System.currentTimeMillis();
- static public synchronized long get(){
- return current++;
- }
- }
Add Comment
Please, Sign In to add comment