Here you can find the source of md5Sum(byte[] data)
public static String md5Sum(byte[] data)
//package com.java2s; /* Copyright 2013 D?nes Derh?n * * This file is part of BlockPhysics.// w w w.j ava 2 s . c o m * * BlockPhysics is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * BlockPhysics is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with BlockPhysics. If not, see <http://www.gnu.org/licenses/>. */ import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static String md5Sum(byte[] data) { if (data == null) return "null"; try { MessageDigest var3 = MessageDigest.getInstance("MD5"); var3.update(data); String s = (new BigInteger(1, var3.digest())).toString(16); while (s.length() < 32) { s = "0" + s; } return s; } catch (NoSuchAlgorithmException var4) { throw new RuntimeException(var4); } } }