Here you can find the source of generateHashUUID(String digestData)
public static UUID generateHashUUID(String digestData)
//package com.java2s; //License from project: Open Source License import java.security.*; import java.util.*; public class Main { public static UUID generateHashUUID(String digestData) { MessageDigest md5;/* www. j ava 2 s . c o m*/ try { md5 = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException exception) { return UUID.randomUUID(); } md5.update(digestData.getBytes()); byte[] data = md5.digest(); StringBuffer hash = new StringBuffer(); for (int i = 0; i < data.length; i++) { byte b = data[i]; if ((b & 0xF0) == 0) hash.append(0); hash.append(Integer.toHexString(b & 0xFF)); } StringBuffer uuid = new StringBuffer(); uuid.append(hash.substring(0, 8)).append('-'); uuid.append(hash.substring(8, 12)).append('-'); uuid.append(hash.substring(12, 16)).append('-'); uuid.append(hash.substring(16, 20)).append('-'); uuid.append(hash.substring(20, 32)); return UUID.fromString(uuid.toString()); } }