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

Completado Publicado Aug 4, 2012 Pagado a la entrega
Completado Pagado a la entrega

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;

}

Programación en C++ Linux Python

Nº del proyecto: #2376813

Sobre el proyecto

1 propuesta Proyecto remoto Activo Aug 4, 2012

Adjudicado a:

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 en 1 día
(7 comentarios)
3.7