Here you can find the source of md5(String str)
public static String md5(String str)
//package com.java2s; //License from project: Apache License import java.math.BigInteger; import java.security.MessageDigest; public class Main { public static String md5(String str) { try {/*from w w w . j a v a2 s . c o m*/ MessageDigest md = MessageDigest.getInstance("MD5"); md.update(str.getBytes()); return new BigInteger(1, md.digest()).toString(16); } catch (Exception e) { e.printStackTrace(); } return str; } }