Here you can find the source of checksumBytesToString(byte[] digestBytes)
public static String checksumBytesToString(byte[] digestBytes)
//package com.java2s; /*// w w w . j a v a 2 s. co m * The contents of this file are subject to the license and copyright * detailed in the LICENSE and NOTICE files at the root of the source * tree and available online at * * http://duracloud.org/license/ */ public class Main { /** * Converts a message digest byte array into a String based * on the hex values appearing in the array. */ public static String checksumBytesToString(byte[] digestBytes) { StringBuffer hexString = new StringBuffer(); for (int i = 0; i < digestBytes.length; i++) { String hex = Integer.toHexString(0xff & digestBytes[i]); if (hex.length() == 1) { hexString.append('0'); } hexString.append(hex); } return hexString.toString(); } }