Đang Thực Hiện

Create python module for crc calculation from existing c++ code

Create a module for use in python (2.7 and 3) on linux using existing c++ code for crc-8 calculation (listed below).

The function takes a string and its length and returns the crc. Optionally the function can take just the string and caluclate the length itself.

Source code and howto on compiling and the whole build process is neccesary.

c++ code for crc calculation:

BYTE CMicraIO::CRC8(char *data, int size)

{

ErrorFunction("CRC8");

BYTE CRC=0, tmp;

int l, a;

if (data != NULL)

{

for(a=0; a<size; a++)

{

tmp = data[a];

for(l=0; l<8; l++)

{

if ((CRC^tmp) & 1)

{

CRC = ((CRC^0x18)>>1) | 0x80;

}

else

{

CRC >>= 1;

}

tmp >>= 1;

}

}

}

else

{

Error("No data to process.");

}

ErrorFunction();

return CRC;

}

Kỹ năng: Lập trình C++, Linux, Python

Xem thêm: crc python code, source c code, neccesary, linux source code, int size c, c for int, python crc8 calculation, python data, Linux python, c++ code, c code, byte, python function, crc code, crc calculation, code crc, code linux, crc source code, data calculation, use crc, python code, calculation crc, data module, python source, howto

Về Bên Thuê:
( 1 nhận xét ) Bribir, Croatia

Mã Dự Án: #2376813

Đã trao cho:

bogdanperian

Can finish it today for python 2.7, though I guess it will work on version 3 too. Source code + doc delivery Cheers;)

€30 EUR trong 1 ngày
(7 Đánh Giá)
3.7