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

Виконано Опубліковано %project.relative_time Оплачується при отриманні
Виконано Оплачується при отриманні

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;

}

Програмування на C++ Linux Python

ID Проекту: #2376813

Про проект

1 заявка Дистанційний проект Остання активність Aug 4, 2012

Доручено:

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 за 1 день
(7 відгуків(-и))
3.7