Java tutorial
//package com.java2s; public class Main { public static String UUID() { String uuid = java.util.UUID.randomUUID().toString(); StringBuilder bf = new StringBuilder(32); for (int i = 0; i < uuid.length(); ++i) { char c = uuid.charAt(i); if (c != '-' && c != '_') { bf.append(c); } } return bf.toString(); } }