Here you can find the source of md5(String content)
public static String md5(String content)
//package com.java2s; //License from project: Open Source License import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static String md5(String content) { if (content == null) { return null; }/*from w ww .j a va 2s .c o m*/ String md5 = null; try { MessageDigest mdEnc = MessageDigest.getInstance("MD5"); mdEnc.update(content.getBytes(), 0, content.length()); md5 = new BigInteger(1, mdEnc.digest()).toString(16); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return md5; } }