def __init__(self, width, poly, reflect_in, xor_in, reflect_out, xor_out, table_idx_width = None):
        """The Crc constructor.

        The parameters are as follows:
            width
            poly
            reflect_in
            xor_in
            reflect_out
            xor_out
        """
        self.Width          = width
        self.Poly           = poly
        self.ReflectIn      = reflect_in
        self.XorIn          = xor_in
        self.ReflectOut     = reflect_out
        self.XorOut         = xor_out
        self.TableIdxWidth  = table_idx_width

        self.MSB_Mask = 0x1 << (self.Width - 1)
        self.Mask = ((self.MSB_Mask - 1) << 1) | 1
        if self.TableIdxWidth != None:
            self.TableWidth = 1 << self.TableIdxWidth
        else:
            self.TableIdxWidth = 8
            self.TableWidth = 1 << self.TableIdxWidth

        self.DirectInit = self.XorIn
        self.NonDirectInit = self.__get_nondirect_init(self.XorIn)
        if self.Width < 8:
            self.CrcShift = 8 - self.Width
        else:
            self.CrcShift = 0
def __init__ ( self , width , poly , reflect_in , xor_in , reflect_out , xor_out , table_idx_width = None ) : self . Width = width self . Poly = poly self . ReflectIn = reflect_in self . XorIn = xor_in self . ReflectOut = reflect_out self . XorOut = xor_out self . TableIdxWidth = table_idx_width self . MSB_Mask = 0x1 << ( self . Width - 1 ) self . Mask = ( ( self . MSB_Mask - 1 ) << 1 ) | 1 if self . TableIdxWidth != None : self . TableWidth = 1 << self . TableIdxWidth else : self . TableIdxWidth = 8 self . TableWidth = 1 << self . TableIdxWidth self . DirectInit = self . XorIn self . NonDirectInit = self . __get_nondirect_init ( self . XorIn ) if self . Width < 8 : self . CrcShift = 8 - self . Width else : self . CrcShift = 0
The Crc constructor.

        The parameters are as follows:
            width
            poly
            reflect_in
            xor_in
            reflect_out
            xor_out