Here you can find the source of sha12String(MessageDigest messageDigest)
public static String sha12String(MessageDigest messageDigest)
//package com.java2s; /**********//from w ww . jav a 2s . co m Copyright ? 2013-2014 Olanto Foundation Geneva This file is part of myTERM. myCAT is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. myCAT 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with myCAT. If not, see <http://www.gnu.org/licenses/>. **********/ import java.security.MessageDigest; import java.util.Formatter; public class Main { public static String sha12String(MessageDigest messageDigest) { // Conversion des bytes en format hex try (Formatter formatter = new Formatter()) { for (final byte b : messageDigest.digest()) { formatter.format("%02x", b); } return formatter.toString(); } } }