Here you can find the source of md5String(String s)
public static String md5String(String s)
//package com.java2s; //License from project: Apache License import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static String md5String(String s) { try {//from w ww . ja v a 2 s . co m MessageDigest messagedigest = MessageDigest.getInstance("MD5"); byte abyte0[] = s.getBytes(); abyte0 = messagedigest.digest(abyte0); StringBuffer stringbuffer = new StringBuffer(32); for (int i = 0; i < abyte0.length; i++) { String s1 = Integer.toHexString(abyte0[i] & 0xff); if (s1.length() == 1) stringbuffer.append('0'); stringbuffer.append(s1); } return stringbuffer.toString(); } catch (NoSuchAlgorithmException _ex) { return ""; } } }