code: public static String md5Encrypt(String str) {
  		byte[] bytes = null;
  		try {
  			bytes = str.getBytes("UTF-8");
  		} catch (Exception e) {
  			bytes = str.getBytes();
  		}
  
  		byte messageDigest[] = null;
  		synchronized (m_md5) {
  			m_md5.update(bytes);
  			messageDigest = m_md5.digest();
  		}
  
  		StringBuffer hexString = new StringBuffer();
  		int d;
  		for (int i = 0; i < messageDigest.length; i++) {
  			d = messageDigest[i];
  			if (d < 0)
  				d += 256;
  			if (d < 16)
  				hexString.append("0");
  			hexString.append(Integer.toHexString(d));
  		}
  		return hexString.toString();
  	}
docs: MD5
  
  @param str
  @return