ZXing.QrCode.Internal.MatrixUtil.calculateBCHCode C# (CSharp) Метод

calculateBCHCode() публичный статический Метод

public static calculateBCHCode ( int value_Renamed, int poly ) : int
value_Renamed int
poly int
Результат int
        public static int calculateBCHCode(int value_Renamed, int poly)
        {
            // If poly is "1 1111 0010 0101" (version info poly), msbSetInPoly is 13. We'll subtract 1
             // from 13 to make it 12.
             int msbSetInPoly = findMSBSet(poly);
             value_Renamed <<= msbSetInPoly - 1;
             // Do the division business using exclusive-or operations.
             while (findMSBSet(value_Renamed) >= msbSetInPoly)
             {
            value_Renamed ^= poly << (findMSBSet(value_Renamed) - msbSetInPoly);
             }
             // Now the "value" is the remainder (i.e. the BCH code)
             return value_Renamed;
        }