Here you can find the source of md5(String str)
public static final byte[] md5(String str)
//package com.java2s; /*/*from w ww . j a v a 2 s . com*/ * BJAF - Beetle J2EE Application Framework * ???J2EE??????????? * ??????2003-2015 ??? (www.beetlesoft.net) * * ?????????????????? *<http://www.apache.org/licenses/LICENSE-2.0> *???????????????????????? * * ??????????????????????????????? * ??? <yuhaodong@gmail.com/>. */ import java.security.NoSuchAlgorithmException; public class Main { public static final byte[] md5(String str) { java.security.MessageDigest digest; try { digest = java.security.MessageDigest.getInstance("MD5"); return digest.digest(str.getBytes()); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return null; } }