Here you can find the source of md5(String toDigest)
public static String md5(String toDigest)
//package com.java2s; /**/*from w ww . jav a2 s .c o m*/ * The New Economy Minecraft Server Plugin * * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/ or send a letter to * Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. * Created by creatorfromhell on 06/30/2017. */ import javax.xml.bind.DatatypeConverter; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static String md5(String toDigest) { String toReturn = ""; try { MessageDigest md = MessageDigest.getInstance("MD5"); md.update(toDigest.getBytes()); byte[] digest = md.digest(); toReturn = DatatypeConverter.printHexBinary(digest).toUpperCase(); md = null; digest = null; } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return toReturn; } }