Here you can find the source of generate()
public static String generate()
//package com.java2s; //License from project: Apache License import java.util.UUID; public class Main { public static String generate() { String s = UUID.randomUUID().toString(); return s.substring(0, 8) + s.substring(9, 13) + s.substring(14, 18) + s.substring(19, 23) + s.substring(24, 36);//from ww w . j av a2s . c o m } }