Advertisement
Nickster258

Simple hexadecimal UUID generator.

Mar 19th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.23 KB | None | 0 0
  1. Random myRandom = new Random();
  2.  
  3. public String getUUID(int length){
  4.     String UUID = "";
  5.     for (int i = 0; i<length; i++) {
  6.         int thisRandom = myRandom.nextInt(16);
  7.         UUID += Integer.toHexString(thisRandom);
  8.     }
  9.     return UUID;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement