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

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

  • 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.

ParametersWidthPlatformData quantityPossible algorithms
Variable, Fixed1-16 bitsEmbedded, DesktopLowbit_by_bit, bit_by_bit_fast
Fixed8, 16 bitsEmbedded, DesktopMedium, Lowbit_by_bit_fast, table_driven (table index width: 4)
Fixed8 or more bitsDesktopMedium, Hightable_driven

Who owns the generated code?

You. I have added a special exception to the copyright statement which permits the use of pycrc#s output in larger works and to distribute that code under terms of your choice.

If you decide to include pycrc's output in your work, I would appreciate a short mention od it in your sorce code or documentation.