pycrc FAQ

  Thomas Pircher

   2007-01-11

   --------------------------------------------------------------------------

   Table of Contents

   General questions

                Why yet another CRC tool?

   pycrc

                But the Python implementation is extremely inefficient!

                Which is the best model?

                Who owns the generated code?

General questions

  Why yet another CRC tool?

   Because I couldn't find any program which met my needs. I wanted an Open
   Source program with

     o an easy to read, fully parametrisable reference implementation in some
       scripting language

     o a clean C source code generator which output could be easily included
       in embedded programs

pycrc

  But the Python implementation is extremely inefficient!

   Good observation! And I'm not going to change this. The Python
   implementation is thought to provide a correct, stable and easy to read
   code bases for further experiments. The right place to do performance
   tuning is the generated C code. I'm happy to consider every suggestion to
   improve the generated code.

  Which is the best model?

   This depends. For occasional computations on small amounts of data the
   optimized bit-by-bit implementation might be a feasable solution and might
   also have a speed which is comparable to other models. On desktop
   computers, with larger amounts of data, the table driven model is a good
   choice, but on embedded platforms, where code space is a major concern, a
   optimized bit_by_bit implementation might be the better choice.

   Parameters Width     Platform  Data        Possible algorithms
                                  quantity
   Variable,  1-16 bits Embedded, Low         bit_by_bit, bit_by_bit_fast
   Fixed                Desktop
   Fixed      8, 16     Embedded, Medium, Low bit_by_bit_fast, table_driven
              bits      Desktop               (table index width: 4)
   Fixed      8 or more Desktop   Medium,     table_driven
              bits                High

  Who owns the generated code?

   This question has become almost irrelevant with the MIT licence introduced
   in version 0.6. The sloppy answer is: you are free to do whatever you like
   with pycrc's the output, as long as the terms of the MIT licence are not
   violated.
