Here you can find the source of md5(String s)
public static String md5(String s)
//package com.java2s; //License from project: Apache License import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import sun.misc.BASE64Encoder; public class Main { public static String md5(String s) { try {/*from w w w . j av a2 s. co m*/ MessageDigest md = MessageDigest.getInstance("md5"); byte b[] = md.digest(s.getBytes()); return new BASE64Encoder().encode(b); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } } }