Пример #1
0
        public byte[] Bytes()
        {
            var dataWithPaddedSingleBit = new CombinedBinaries(
                _data,
                new Binary(new [] { _singleBitWithLackingZeroBytes })
                );

            var paddedDataLengthInBytes = dataWithPaddedSingleBit
                                          .Bytes()
                                          .Count();
            var lackingBytesCount = _blockSize - (paddedDataLengthInBytes % 8);
            var lackingBytes      = Enumerable
                                    .Range(0, lackingBytesCount)
                                    .Select(i => (byte)0x00);

            return(new CombinedBinaries(
                       dataWithPaddedSingleBit,
                       new Binary(lackingBytes)
                       ).Bytes());
        }
        public byte[] Bytes()
        {
            var commandData = new CombinedBinaries(
                _do87,
                _do97,
                _do8e
                );

            var commandDataLengthAsBinaryHex = new HexInt(
                commandData
                .Bytes()
                .Count()
                );

            return(new CombinedBinaries(
                       _maskedCommandApduHeader,
                       commandDataLengthAsBinaryHex,
                       commandData,
                       new Binary(_exceptedDataLength)
                       ).Bytes());
        }