__init__(self,
width,
polynomial,
name=None,
seed=0,
lsbFirst=False,
lsbFirstData=None,
xorMask=0)
(Constructor)
| source code
|
- Parameters:
width (an integer) - The number of bits in the CRC register, or equivalently, the
degree of the polynomial.
polynomial (sequence or integer) - The generator polynomial as a sequence of exponents
name (str) - A name identifying algorithm.
seed (an integer) - The initial value to load into the register. (This is the
value without xorMask applied.)
lsbFirst (bool) - If true, the register shifts toward the
least-significant bit (sometimes called the reflected or
reversed algorithim). Otherwise, the register shifts
toward the most-significant bit.
lsbFirstData (bool) - If true, input data is taken least-significant bit
first. Otherwise, data is taken most-significant bit first.
If None or not given, the value of lsbFirst is used.
xorMask (an integer) - An integer mask indicating which bits should be inverted
when returning the final result. This is also used for the
input value if provided.
|