Package: crcmod-plus
crcmodfor calculating CRCsThe software in this repository is a modernised version of thecrcmodPython
package, originally written by Ray Buvel. I took the original source code ofcrcmod1.7, dropped support for Python 2, reformatted the source files withblack, ran it throughruff, and added a modern build pipeline around it
based onsetuptools,pytest,toxandcibuildwheelso I can create
pre-compiled wheels for the package using Github Actions.Version 2.0.0 of this package is a drop-in replacement forcrcmod1.7 if
you are running Python 3.7 or later.The contents of the original README file follows from here, with minor
alterations to the building and testing instructions to describe how it is done
now with the new setup.The software in this package is a Python module for generating objects that
compute the Cyclic Redundancy Check (CRC).  There is no attempt in this package
to explain how the CRC works.  There are a number of resources on the web that
give a good explanation of the algorithms.  Just do a Google search for "crc
calculation" and browse till you find what you need.  Another resource can be
found in chapter 20 of the book "Numerical Recipes in C" by Press et. al.This package allows the use of any 8, 16, 24, 32, or 64 bit CRC.  You can
generate a Python function for the selected polynomial or an instance of the
Crc class which provides the same interface as themd5andshamodules
from the Python standard library.  ACrcclass instance can also generate
C/C++ source code that can be used in another application.GuidelinesDocumentation is available from the doc strings.  It is up to you to decide
what polynomials to use in your application.  If someone has not specified the
polynomials to use, you will need to do some research to find one suitable for
your application.  Examples are available in the unit tests in thetestsfolder.  You may also use thepredefinedmodule to select one of the standard
polynomials.If you need to generate code for another language, I suggest you subclass theCrcclass and replace the methodgenerateCode.  UsegenerateCodeas
a model for the new version.DependenciesPython versionThis package supports Python 3.7 and newer.Building C extensionTo build the C extension, the appropriate compiler tools for your platform must
be installed. Refer to the Python documentation for building C extensions for
details. If you have a C compiler and all the usual Python development tools,
including thebuildfrontend, then runningpython -m buildshould build the
package.InstallationThecrcmod-pluspackage is installed from PyPI usingpip. Run the following
command:$pipinstallcrcmod-plusUnit testingcrcmod-plususespytestas the testing environment. You can run the unit
tests with:$pytesttestsCode generationThecrcmodpackage is capable of generating C functions that can be compiled
with a C or C++ compiler.  In thetestsdirectory, there is anexamples.pyscript that demonstrates how to use the code generator.  The result of this is
written out to the fileexamples.c.  The generated code was checked to make
sure it compiles with the GCC compiler.LicenseThecrcmod-pluspackage is released under the MIT license. See theLICENSEfile for details.AuthorsRay Buvel (the originalcrcmodpackage)ContributorsCraig McQueen (contributor of the originalcrcmodpackage)Tamas Nepusz (modernisation intocrcmod-plus)