code: public static int bitPolyModulus(int data , int generator , int totalBits, int dataBits) {
  		int errorBits = totalBits-dataBits;
  		for (int i = dataBits-1; i >= 0; i--) {
  			if( (data & (1 << (i+errorBits))) != 0 ) {
  				data ^= generator << i;
  			}
  		}
  		return data;
  	}
docs: Performs division using xcr operators on the encoded polynomials. used in BCH encoding/decoding
  @param data Data being checked
  @param generator Generator polynomial
  @param totalBits Total number of bits in data
  @param dataBits Number of data bits. Rest are error correction bits
  @return Remainder after polynomial division