Here you can find the source of md5(String source)
public static String md5(String source)
//package com.java2s; //License from project: Open Source License import javax.xml.bind.DatatypeConverter; import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static String md5(String source) { byte[] bytes; try {// www .j a va 2s. c o m bytes = MessageDigest.getInstance("MD5").digest(source.getBytes("UTF-8")); } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) { return null; } return DatatypeConverter.printHexBinary(bytes).toLowerCase(); } }