| 1 |
Metadata-Version: 1.0 |
| 2 |
Name: crcmod |
| 3 |
Version: 1.7 |
| 4 |
Summary: CRC Generator |
| 5 |
Home-page: http://crcmod.sourceforge.net/ |
| 6 |
Author: Ray Buvel |
| 7 |
Author-email: [email protected] |
| 8 |
License: MIT |
| 9 |
Download-URL: http://sourceforge.net/projects/crcmod |
| 10 |
Description: =========================== |
| 11 |
crcmod for Calculating CRCs |
| 12 |
=========================== |
| 13 |
|
| 14 |
The software in this package is a Python module for generating objects that |
| 15 |
compute the Cyclic Redundancy Check (CRC). There is no attempt in this package |
| 16 |
to explain how the CRC works. There are a number of resources on the web that |
| 17 |
give a good explanation of the algorithms. Just do a Google search for "crc |
| 18 |
calculation" and browse till you find what you need. Another resource can be |
| 19 |
found in chapter 20 of the book "Numerical Recipes in C" by Press et. al. |
| 20 |
|
| 21 |
This package allows the use of any 8, 16, 24, 32, or 64 bit CRC. You can |
| 22 |
generate a Python function for the selected polynomial or an instance of the |
| 23 |
Crc class which provides the same interface as the ``md5`` and ``sha`` modules |
| 24 |
from the Python standard library. A ``Crc`` class instance can also generate |
| 25 |
C/C++ source code that can be used in another application. |
| 26 |
|
| 27 |
---------- |
| 28 |
Guidelines |
| 29 |
---------- |
| 30 |
|
| 31 |
Documentation is available from the doc strings. It is up to you to decide |
| 32 |
what polynomials to use in your application. If someone has not specified the |
| 33 |
polynomials to use, you will need to do some research to find one suitable for |
| 34 |
your application. Examples are available in the unit test script ``test.py``. |
| 35 |
You may also use the ``predefined`` module to select one of the standard |
| 36 |
polynomials. |
| 37 |
|
| 38 |
If you need to generate code for another language, I suggest you subclass the |
| 39 |
``Crc`` class and replace the method ``generateCode``. Use ``generateCode`` as |
| 40 |
a model for the new version. |
| 41 |
|
| 42 |
------------ |
| 43 |
Dependencies |
| 44 |
------------ |
| 45 |
|
| 46 |
Python Version |
| 47 |
^^^^^^^^^^^^^^ |
| 48 |
|
| 49 |
The package has separate code to support the 2.x and 3.x Python series. |
| 50 |
|
| 51 |
For the 2.x versions of Python, these versions have been tested: |
| 52 |
|
| 53 |
* 2.4 |
| 54 |
* 2.5 |
| 55 |
* 2.6 |
| 56 |
* 2.7 |
| 57 |
|
| 58 |
It may still work on earlier versions of Python 2.x, but these have not been |
| 59 |
recently tested. |
| 60 |
|
| 61 |
For the 3.x versions of Python, these versions have been tested: |
| 62 |
|
| 63 |
* 3.1 |
| 64 |
|
| 65 |
Building C extension |
| 66 |
^^^^^^^^^^^^^^^^^^^^ |
| 67 |
|
| 68 |
To build the C extension, the appropriate compiler tools for your platform must |
| 69 |
be installed. Refer to the Python documentation for building C extensions for |
| 70 |
details. |
| 71 |
|
| 72 |
------------ |
| 73 |
Installation |
| 74 |
------------ |
| 75 |
|
| 76 |
The crcmod package is installed using ``distutils``. |
| 77 |
Run the following command:: |
| 78 |
|
| 79 |
python setup.py install |
| 80 |
|
| 81 |
If the extension module builds, it will be installed. Otherwise, the |
| 82 |
installation will include the pure Python version. This will run significantly |
| 83 |
slower than the extension module but will allow the package to be used. |
| 84 |
|
| 85 |
For Windows users who want to use the mingw32 compiler, run this command:: |
| 86 |
|
| 87 |
python setup.py build --compiler=mingw32 install |
| 88 |
|
| 89 |
For Python 3.x, the install process is the same but you need to use the 3.x |
| 90 |
interpreter. |
| 91 |
|
| 92 |
------------ |
| 93 |
Unit Testing |
| 94 |
------------ |
| 95 |
|
| 96 |
The ``crcmod`` package has a module ``crcmod.test``, which contains unit |
| 97 |
tests for both ``crcmod`` and ``crcmod.predefined``. |
| 98 |
|
| 99 |
When you first install ``crcmod``, you should run the unit tests to make sure |
| 100 |
everything is installed properly. The test script performs a number of tests |
| 101 |
including a comparison to the direct method which uses a class implementing |
| 102 |
polynomials over the integers mod 2. |
| 103 |
|
| 104 |
To run the unit tests on Python >=2.5:: |
| 105 |
|
| 106 |
python -m crcmod.test |
| 107 |
|
| 108 |
Alternatively, in the ``test`` directory run:: |
| 109 |
|
| 110 |
python test_crcmod.py |
| 111 |
|
| 112 |
--------------- |
| 113 |
Code Generation |
| 114 |
--------------- |
| 115 |
|
| 116 |
The crcmod package is capable of generating C functions that can be compiled |
| 117 |
with a C or C++ compiler. In the test directory, there is an examples.py |
| 118 |
script that demonstrates how to use the code generator. The result of this is |
| 119 |
written out to the file ``examples.c``. The generated code was checked to make |
| 120 |
sure it compiles with the GCC compiler. |
| 121 |
|
| 122 |
------- |
| 123 |
License |
| 124 |
------- |
| 125 |
|
| 126 |
The ``crcmod`` package is released under the MIT license. See the ``LICENSE`` |
| 127 |
file for details. |
| 128 |
|
| 129 |
------------ |
| 130 |
Contributors |
| 131 |
------------ |
| 132 |
|
| 133 |
Craig McQueen |
| 134 |
|
| 135 |
Platform: UNKNOWN |
| 136 |
Classifier: Development Status :: 5 - Production/Stable |
| 137 |
Classifier: Intended Audience :: Developers |
| 138 |
Classifier: Intended Audience :: Education |
| 139 |
Classifier: Intended Audience :: End Users/Desktop |
| 140 |
Classifier: Intended Audience :: Information Technology |
| 141 |
Classifier: Intended Audience :: Science/Research |
| 142 |
Classifier: License :: OSI Approved :: MIT License |
| 143 |
Classifier: Operating System :: OS Independent |
| 144 |
Classifier: Programming Language :: C |
| 145 |
Classifier: Programming Language :: C++ |
| 146 |
Classifier: Programming Language :: Python |
| 147 |
Classifier: Programming Language :: Python :: 2 |
| 148 |
Classifier: Programming Language :: Python :: 2.4 |
| 149 |
Classifier: Programming Language :: Python :: 2.5 |
| 150 |
Classifier: Programming Language :: Python :: 2.6 |
| 151 |
Classifier: Programming Language :: Python :: 2.7 |
| 152 |
Classifier: Programming Language :: Python :: 3 |
| 153 |
Classifier: Programming Language :: Python :: 3.1 |
| 154 |
Classifier: Topic :: Communications |
| 155 |
Classifier: Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator |
| 156 |
Classifier: Topic :: Scientific/Engineering :: Mathematics |
| 157 |
Classifier: Topic :: Utilities |