code: static String toHex(byte[] data) {
  
          StringBuffer sb = new StringBuffer(data.length*2);
  
          for (int i=0; i<data.length; i++) {
              sb.append(hexc[(data[i] >>4) & 0x0f]);
              sb.append(hexc[data[i] & 0x0f]);
          }
          return sb.toString();
      }
docs: convert a byte array to a hex string for debugging purposes
  @param data the binary data to be converted to a hex string
  @return an ASCII hex string