crcmod


Namecrcmod JSON
Version 1.7 PyPI version JSON
download
home_pagehttp://crcmod.sourceforge.net/
SummaryCRC Generator
upload_time2010-06-27 14:35:29
maintainerNone
docs_urlNone
authorRay Buvel
requires_pythonNone
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ===========================
crcmod for Calculating CRCs
===========================

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 the ``md5`` and ``sha`` modules
from the Python standard library.  A ``Crc`` class instance can also generate
C/C++ source code that can be used in another application.

----------
Guidelines
----------

Documentation 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 test script ``test.py``.
You may also use the ``predefined`` module to select one of the standard
polynomials.

If you need to generate code for another language, I suggest you subclass the
``Crc`` class and replace the method ``generateCode``.  Use ``generateCode`` as
a model for the new version.

------------
Dependencies
------------

Python Version
^^^^^^^^^^^^^^

The package has separate code to support the 2.x and 3.x Python series.

For the 2.x versions of Python, these versions have been tested:

* 2.4
* 2.5
* 2.6
* 2.7

It may still work on earlier versions of Python 2.x, but these have not been
recently tested.

For the 3.x versions of Python, these versions have been tested:

* 3.1

Building C extension
^^^^^^^^^^^^^^^^^^^^

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

------------
Installation
------------

The crcmod package is installed using ``distutils``.
Run the following command::

    python setup.py install

If the extension module builds, it will be installed.  Otherwise, the
installation will include the pure Python version.  This will run significantly
slower than the extension module but will allow the package to be used.

For Windows users who want to use the mingw32 compiler, run this command::

    python setup.py build --compiler=mingw32 install

For Python 3.x, the install process is the same but you need to use the 3.x
interpreter.

------------
Unit Testing
------------

The ``crcmod`` package has a module ``crcmod.test``, which contains unit
tests for both ``crcmod`` and ``crcmod.predefined``.

When you first install ``crcmod``, you should run the unit tests to make sure
everything is installed properly.  The test script performs a number of tests
including a comparison to the direct method which uses a class implementing
polynomials over the integers mod 2.

To run the unit tests on Python >=2.5::

    python -m crcmod.test

Alternatively, in the ``test`` directory run::

    python test_crcmod.py

---------------
Code Generation
---------------

The crcmod package is capable of generating C functions that can be compiled
with a C or C++ compiler.  In the test directory, there is an examples.py
script that demonstrates how to use the code generator.  The result of this is
written out to the file ``examples.c``.  The generated code was checked to make
sure it compiles with the GCC compiler.

-------
License
-------

The ``crcmod`` package is released under the MIT license. See the ``LICENSE``
file for details.

------------
Contributors
------------

Craig McQueen
            

Raw data

            {
    "_id": null,
    "home_page": "http://crcmod.sourceforge.net/",
    "name": "crcmod",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Ray Buvel",
    "author_email": "rlbuvel@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6b/b0/e595ce2a2527e169c3bcd6c33d2473c1918e0b7f6826a043ca1245dd4e5b/crcmod-1.7.tar.gz",
    "platform": "UNKNOWN",
    "description": "===========================\ncrcmod for Calculating CRCs\n===========================\n\nThe software in this package is a Python module for generating objects that\ncompute the Cyclic Redundancy Check (CRC).  There is no attempt in this package\nto explain how the CRC works.  There are a number of resources on the web that\ngive a good explanation of the algorithms.  Just do a Google search for \"crc\ncalculation\" and browse till you find what you need.  Another resource can be\nfound in chapter 20 of the book \"Numerical Recipes in C\" by Press et. al.\n\nThis package allows the use of any 8, 16, 24, 32, or 64 bit CRC.  You can\ngenerate a Python function for the selected polynomial or an instance of the\nCrc class which provides the same interface as the ``md5`` and ``sha`` modules\nfrom the Python standard library.  A ``Crc`` class instance can also generate\nC/C++ source code that can be used in another application.\n\n----------\nGuidelines\n----------\n\nDocumentation is available from the doc strings.  It is up to you to decide\nwhat polynomials to use in your application.  If someone has not specified the\npolynomials to use, you will need to do some research to find one suitable for\nyour application.  Examples are available in the unit test script ``test.py``.\nYou may also use the ``predefined`` module to select one of the standard\npolynomials.\n\nIf you need to generate code for another language, I suggest you subclass the\n``Crc`` class and replace the method ``generateCode``.  Use ``generateCode`` as\na model for the new version.\n\n------------\nDependencies\n------------\n\nPython Version\n^^^^^^^^^^^^^^\n\nThe package has separate code to support the 2.x and 3.x Python series.\n\nFor the 2.x versions of Python, these versions have been tested:\n\n* 2.4\n* 2.5\n* 2.6\n* 2.7\n\nIt may still work on earlier versions of Python 2.x, but these have not been\nrecently tested.\n\nFor the 3.x versions of Python, these versions have been tested:\n\n* 3.1\n\nBuilding C extension\n^^^^^^^^^^^^^^^^^^^^\n\nTo build the C extension, the appropriate compiler tools for your platform must\nbe installed. Refer to the Python documentation for building C extensions for\ndetails.\n\n------------\nInstallation\n------------\n\nThe crcmod package is installed using ``distutils``.\nRun the following command::\n\n    python setup.py install\n\nIf the extension module builds, it will be installed.  Otherwise, the\ninstallation will include the pure Python version.  This will run significantly\nslower than the extension module but will allow the package to be used.\n\nFor Windows users who want to use the mingw32 compiler, run this command::\n\n    python setup.py build --compiler=mingw32 install\n\nFor Python 3.x, the install process is the same but you need to use the 3.x\ninterpreter.\n\n------------\nUnit Testing\n------------\n\nThe ``crcmod`` package has a module ``crcmod.test``, which contains unit\ntests for both ``crcmod`` and ``crcmod.predefined``.\n\nWhen you first install ``crcmod``, you should run the unit tests to make sure\neverything is installed properly.  The test script performs a number of tests\nincluding a comparison to the direct method which uses a class implementing\npolynomials over the integers mod 2.\n\nTo run the unit tests on Python >=2.5::\n\n    python -m crcmod.test\n\nAlternatively, in the ``test`` directory run::\n\n    python test_crcmod.py\n\n---------------\nCode Generation\n---------------\n\nThe crcmod package is capable of generating C functions that can be compiled\nwith a C or C++ compiler.  In the test directory, there is an examples.py\nscript that demonstrates how to use the code generator.  The result of this is\nwritten out to the file ``examples.c``.  The generated code was checked to make\nsure it compiles with the GCC compiler.\n\n-------\nLicense\n-------\n\nThe ``crcmod`` package is released under the MIT license. See the ``LICENSE``\nfile for details.\n\n------------\nContributors\n------------\n\nCraig McQueen",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "CRC Generator",
    "version": "1.7",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "2d5b92117d958dcead94f9e17f54cd32",
                "sha256": "dc7051a0db5f2bd48665a990d3ec1cc305a466a77358ca4492826f41f283601e"
            },
            "downloads": -1,
            "filename": "crcmod-1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "2d5b92117d958dcead94f9e17f54cd32",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 89670,
            "upload_time": "2010-06-27T14:35:29",
            "upload_time_iso_8601": "2010-06-27T14:35:29.538193Z",
            "url": "https://files.pythonhosted.org/packages/6b/b0/e595ce2a2527e169c3bcd6c33d2473c1918e0b7f6826a043ca1245dd4e5b/crcmod-1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "b1bb152f09810f0206aa378b42ad5e83",
                "sha256": "69a2e5c6c36d0f096a7beb4cd34e5f882ec5fd232efb710cdb85d4ff196bd52e"
            },
            "downloads": -1,
            "filename": "crcmod-1.7.win32-py2.6.msi",
            "has_sig": false,
            "md5_digest": "b1bb152f09810f0206aa378b42ad5e83",
            "packagetype": "bdist_msi",
            "python_version": "2.6",
            "requires_python": null,
            "size": 131072,
            "upload_time": "2010-07-20T13:51:14",
            "upload_time_iso_8601": "2010-07-20T13:51:14.940141Z",
            "url": "https://files.pythonhosted.org/packages/93/3e/d35aac587d583600f46281f7a794500b02066e095335091bd71f750085f8/crcmod-1.7.win32-py2.6.msi",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "feba8cafe2849bc7bffadba6f21f37dd",
                "sha256": "737fb308fa2ce9aed2e29075f0d5980d4a89bfbec48a368c607c5c63b3efb90e"
            },
            "downloads": -1,
            "filename": "crcmod-1.7.win32-py2.7.msi",
            "has_sig": false,
            "md5_digest": "feba8cafe2849bc7bffadba6f21f37dd",
            "packagetype": "bdist_msi",
            "python_version": "2.7",
            "requires_python": null,
            "size": 131072,
            "upload_time": "2010-07-20T13:51:49",
            "upload_time_iso_8601": "2010-07-20T13:51:49.905109Z",
            "url": "https://files.pythonhosted.org/packages/e9/92/de3272d0bc951f93a871eff1b08011274865b6622d05ad304c7687f8bf86/crcmod-1.7.win32-py2.7.msi",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "7c12a1a1434c68b760dd9575bdebbd17",
                "sha256": "50586ab48981f11e5b117523d97bb70864a2a1af246cf6e4f5c4a21ef4611cd1"
            },
            "downloads": -1,
            "filename": "crcmod-1.7.win32-py3.1.msi",
            "has_sig": false,
            "md5_digest": "7c12a1a1434c68b760dd9575bdebbd17",
            "packagetype": "bdist_msi",
            "python_version": "3.1",
            "requires_python": null,
            "size": 131072,
            "upload_time": "2010-07-20T13:52:25",
            "upload_time_iso_8601": "2010-07-20T13:52:25.465775Z",
            "url": "https://files.pythonhosted.org/packages/b9/50/ecc32553cb0570bed5cace11af641a544792268aae186381f9aaf4873d02/crcmod-1.7.win32-py3.1.msi",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2010-06-27 14:35:29",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "crcmod"
}
        
Elapsed time: 0.03383s