Here you can find the source of getHashKey(String input)
public static byte[] getHashKey(String input)
//package com.java2s; //License from project: Open Source License import java.io.UnsupportedEncodingException; import java.nio.ByteBuffer; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static byte[] getHashKey(String input) { byte[] bytesOfMessage = null, digestMessage = null; ByteBuffer buffer = ByteBuffer.allocate(16); if (input == null) { buffer.putInt(0, 0);//from w w w. ja va 2s . c om return buffer.array(); } try { bytesOfMessage = input.getBytes("UTF-8"); MessageDigest md = MessageDigest.getInstance("MD5"); digestMessage = md.digest(bytesOfMessage); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (NoSuchAlgorithmException e) { // TODO Auto-generated catch block e.printStackTrace(); } return digestMessage; } }