Exemplo n.º 1
0
        private IEnumerable <bool> TerminatorUsingReferenceImplementation(int numDataBits, int numTotalByte)
        {
            BitVector dataBits = new BitVector();

            dataBits.Append(1, numDataBits);
            EncoderInternal.terminateBits(numTotalByte, dataBits);
            return(dataBits);
        }
Exemplo n.º 2
0
        private BitVector GenerateDataCodewords(int numDataCodewords, Random randomizer)
        {
            BitVector result = new BitVector();

            for (int numDC = 0; numDC < numDataCodewords; numDC++)
            {
                result.Append((randomizer.Next(0, 256) & 0xFF), s_bitLengthForByte);
            }
            if (result.sizeInBytes() == numDataCodewords)
            {
                return(result);
            }
            else
            {
                throw new Exception("Auto generate data codewords fail");
            }
        }