code: public static byte[] calculate(final Data[] data) throws IOException {
          int bitSize = 0;
          for (final Data target : data) {
              bitSize += target.numOfBits;
          }
          int pos = 0;
          final FastBitSet bitSet = new FastBitSet(bitSize);
          for (final Data target : data) {
              int count = 0;
              final byte[] bytes = calculate(target);
              for (final byte b : bytes) {
                  byte bits = b;
                  for (int j = 0; j < 8; j++) {
                      bitSet.set(pos, (bits & 0x1) == 0x1);
                      pos++;
                      count++;
                      if (count >= target.numOfBits) {
                          break;
                      }
                      bits >>= 1;
                  }
              }
          }
          return bitSet.toByteArray();
      }
docs: Calculates MinHash value.
  
  @param data data with analyzer, text and the number of bits
  @return MinHash value
  @throws IOException