Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 21st, 2012  |  syntax: None  |  size: 0.25 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Is unique id generation using UUID really unique?
  2. AtomicLong counter = new AtomicLong(System.currentTimeMillis()*1000);
  3.  
  4. long id = counter.incrementAndGet();
  5.  
  6. // something like ctz9yamgu8
  7. String id = Long.toString(counter.incrementAndGet(), 36);