Here you can find the source of MD5Encode(String origin)
public static String MD5Encode(String origin)
//package com.java2s; import java.security.MessageDigest; public class Main { public static String MD5Encode(String origin) { StringBuffer sb = new StringBuffer(); try {//from www . jav a 2 s . c om MessageDigest md = MessageDigest.getInstance("MD5"); md.update(origin.getBytes("utf8")); byte[] result = md.digest(); for (int i = 0; i < result.length; i++) { int val = (result[i] & 0x000000ff) | 0xffffff00; sb.append(Integer.toHexString(val).substring(6)); } } catch (Exception e) { e.printStackTrace(); } return sb.toString(); } }