Here you can find the source of md5(String str)
public static byte[] md5(String str)
//package com.java2s; //License from project: Apache License import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static byte[] md5(String str) { try {// ww w . j a va 2 s. c o m MessageDigest digest = MessageDigest.getInstance("md5"); byte[] digested = digest.digest(str.getBytes()); return digested; } catch (NoSuchAlgorithmException e) { e.printStackTrace(); return null; } } }