Beispiel #1
0
        public AugmentedCRC(int Bits, T TruncPoly)
        {
            this.Bits      = Bits;
            this.TruncPoly = TruncPoly;

            masking_type = new MaskUint <T>(Bits);

            crc_table_type = new CRCtable <T>(Bits, TruncPoly, false);

            crc_table_type.InitTable();
        }
Beispiel #2
0
        /// <summary>
        /// Конструктор ЦРЦ-вычислителя
        /// </summary>
        public CRCoptimal(int Bits, T TruncPoly, T InitialRemainder, T FinalXorValue, bool ReflectInput = false, bool ReflectRemainder = false)
        {
            this.Bits             = Bits;
            this.ReflectInput     = ReflectInput;
            this.FinalXorValue    = FinalXorValue;
            this.ReflectRemainder = ReflectRemainder;
            this.TruncPoly        = TruncPoly;
            this.InitialRemainder = InitialRemainder;

            masking_type = new MaskUint <T>(Bits);
            helper_type  = new CRChelper <T>(Bits, ReflectInput);

            reflect_out_type = new CRChelper <T>(Bits, (ReflectRemainder != ReflectInput));

            Remainder = helper_type.reflect(InitialRemainder);

            crc_table_type = new CRCtable <T>(Bits, TruncPoly, ReflectInput);

            crc_table_type.InitTable();
        }