Here you can find the source of getHashMDFive(String str)
public static String getHashMDFive(String str) throws RuntimeException
//package com.java2s; //License from project: Apache License import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static String getHashMDFive(String str) throws RuntimeException { try {//w w w . j a v a 2s . com byte[] strBytes = str.getBytes("UTF-8"); MessageDigest md = MessageDigest.getInstance("MD5"); byte[] hashByte = md.digest(strBytes); // Convert the byte to hex format StringBuilder sb = new StringBuilder(); for (byte aHashByte : hashByte) { sb.append(Integer.toString((aHashByte & 0xff) + 0x100, 16).substring(1)); } return sb.toString(); } catch (UnsupportedEncodingException | NoSuchAlgorithmException e) { throw new RuntimeException(e); } } }