code: public static String toHex( byte[] bytes ) {
          StringBuffer buf = new StringBuffer();
          for( int i = 0; i < bytes.length; i++ ) {
              byte b = bytes[i];
              buf.append(toHexDigit((b >> 4) & 0x0F));
              buf.append(toHexDigit(b & 0x0F));
          }
          return buf.toString();
      }
docs: Converts a byte array to a hexadecimal string.
  
  @param bytes a byte array
  @return a string of hexadecimal digits