C++ (Qt)int sum = 0;for(int i = 0;i < byte1.size(); ++i) sum+= (unsigned char)byte1[i]; ....unsigned char c = ((unsigned char*)(&sum))[0] ; //получаем первый байт у int'a
C++ (Qt) ....unsigned char c = ((unsigned char*)(&sum))[0] ; //получаем первый байт у int'a
C++ (Qt)unsigned char c = unsigned char(sum & 0xFF);
quint16 qChecksum ( const char * data, uint len );uint qHash ( const QByteArray & key );
C++ (Qt) quint32 x = 0x1A2B; quint32 y; y = x & 0x00FF; ui->label_1->setText(QString::number(y, 16)); y = x >> 8; ui->label_2->setText(QString::number(y, 16));