Java tutorial
//package com.java2s; import java.math.BigInteger; import java.security.MessageDigest; public class Main { public static String getMd5(String source) { try { MessageDigest md5 = MessageDigest.getInstance("MD5"); md5.update(source.getBytes()); BigInteger bi = new BigInteger(1, md5.digest()); return String.format("%032x", bi); } catch (Exception e) { return ""; } } }