Here you can find the source of generateUniqueId()
public static String generateUniqueId()
//package com.java2s; //License from project: Apache License import java.util.Locale; import java.util.Random; public class Main { private static String UNIQUEID_LETTERS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; private static int UNIQUEID_DEFAULTSIZE = 6; public static String generateUniqueId() { StringBuilder sb = new StringBuilder(UNIQUEID_DEFAULTSIZE); Random random = new Random(); for (int i = 0; i < UNIQUEID_DEFAULTSIZE; i++) { sb.append(UNIQUEID_LETTERS.charAt(random.nextInt(UNIQUEID_LETTERS.length()))); }//from w w w. java2 s .c o m return sb.toString().toLowerCase(Locale.US); } }