code: private static String encodeHex(final byte[] data) {
          String rval = "";
          for (final byte b : data) {
              rval += String.format("%02x", b);
          }
          return rval;
      }
docs: TODO: this is something to optimize