Here you can find the source of bytetoString(byte[] digest)
public static String bytetoString(byte[] digest)
//package com.java2s; //License from project: Apache License public class Main { public static String bytetoString(byte[] digest) { String str = ""; String tempStr = ""; for (int i = 0; i < digest.length; i++) { tempStr = (Integer.toHexString(digest[i] & 0xff)); if (tempStr.length() == 1) { str = str + "0" + tempStr; } else { str = str + tempStr;/*from w ww.ja v a2 s . c o m*/ } } return str.toLowerCase(); } }