Here you can find the source of generate()
public static String generate()
//package com.java2s; //License from project: Open Source License import java.util.UUID; public class Main { public static String generate() { UUID uuid = UUID.randomUUID(); return uuid.toString().replace("-", ""); }/*from w w w . j a v a2 s. co m*/ public static String generate(String userId) { UUID uuid = UUID.nameUUIDFromBytes(userId.getBytes()); return uuid.toString().replace("-", ""); } }