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 ( ' ' ) ; } hexString . append ( hex ) ; } return hexString . toString ( ) ; }
Converts a message digest byte array into a String based on the hex values appearing in the array .