Here you can find the source of generateId()
public static String generateId()
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { static long seed = 0; public static String generateId() { long seed1 = System.currentTimeMillis(); while (seed1 == seed) seed1 = System.currentTimeMillis(); // Make sure we'll don't get the // same seed twice seed = seed1;/*w w w .ja v a2s . c o m*/ Random r = new Random(seed); return Integer.toString(r.nextInt(), 16) + "-" + Integer.toString(r.nextInt(65535), 16) + "-" + Integer.toString(r.nextInt(65535), 16) + "-" + Integer.toString(r.nextInt(65535), 16); } }