Here you can find the source of stringGetMD5String(String s)
public static String stringGetMD5String(String s)
//package com.java2s; import java.security.MessageDigest; public class Main { public static String stringGetMD5String(String s) { byte[] data; MessageDigest md5;//w w w .j a v a 2 s . c om try { data = s.getBytes("UTF-8"); md5 = MessageDigest.getInstance("MD5"); } catch (Exception e) { return null; } byte[] hash = md5.digest(data); StringBuilder hashStr = new StringBuilder(); for (byte byteValue : hash) { hashStr.append(String.format("%02x", byteValue)); } return hashStr.toString(); } }