static String digestString(byte[] digest){
  StringBuffer sb=new StringBuffer(digest.length * 2);
  for (int i=0; i < digest.length; i++) {
    byte b=digest[i];
    sb.append(Character.forDigit((b >> 4) & 0xf,16));
    sb.append(Character.forDigit(b & 0xf,16));
  }
  return sb.toString();
}

static String digestString ( byte [ ] digest ) { StringBuffer sb = new StringBuffer ( digest . length * 2 ) ; for ( int i = 0 ; i < digest . length ; i ++ ) { byte b = digest [ i ] ; sb . append ( Character . forDigit ( ( b > > 4 ) & 0xf , 16 ) ) ; sb . append ( Character . forDigit ( b & 0xf , 16 ) ) ; } return sb . toString ( ) ; }
converts a message digest to a string in hexadecimal format .
