public static bool IsCrcValid(BinaryPolynomial polynomialForCheck) { var polynomial = polynomialForCheck.Copy(); var divisionResult = BinaryPolynomial.Division(polynomial, GeneratorPolynomial); return(divisionResult.Item2.IsNullPolynomial); }
public static BinaryPolynomial GenerateCrc(BinaryPolynomial polynomial) { var polynomialWithPaddingShift = polynomial.Copy().RiseDegree(Padding); var divisionResult = BinaryPolynomial.Division(polynomialWithPaddingShift, GeneratorPolynomial); return(polynomialWithPaddingShift + divisionResult.Item2); }