====================================
Python library for calculating CRC16
====================================
CRC is a way of detecting accidental changes in data storage or
transmission. There are many variants of CRC and CRC16, in particular.
This library calculates only CRC16 (16-bit codes) and the only supported
variant at the moment is CRC-CCITT (XModem).
If you want to know more about CRC,
http://wikipedia.org/wiki/Cyclic_redundancy_check is a good place to start.
If you want other variants of CRC16 supported, please make a request at
http://code.google.com/p/pycrc16/issues
Source codes are hosted at https://github.com/gennady/pycrc16
If you want to contribute to this library, create a fork, make you changes
and then create a pull request. Any help is appreciated.
------------
Installation
------------
On Windows you can use precompiled binaries which can be found at
http://code.google.com/p/pycrc16/downloads
On Linux and other operation systems you should compile the library from
the source codes. To do this on Linux use following steps:
* download source tarball, e.g. crc16-0.1.1.tar.gz,
from http://code.google.com/p/pycrc16/downloads
* extract it with command::
tar -xzf crc16-0.1.1.tar.gz
* compile and install the library::
cd crc16-0.1.1
python setup.py build
sudo python setup.py install
you will need the administrative privileges to execute the last
command.
After installation you can run unit tests to make sure that the library
works fine. Execute::
python -m crc16.test
-----
Usage
-----
In Python 3::
import crc16
print(crc16.crc16xmodem(b'123456789'))
In Python 2 you should use strings instead of binary data::
import crc16
print(crc16.crc16xmodem('123456789'))
You can also calculate CRC gradually::
import crc16
crc = crc16.crc16xmodem(b'1234')
crc = crc16.crc16xmodem(b'56789', crc)
print(crc)
--------------
Other projects
--------------
There are a number of projects and libraries for CRC calculation.
See for example:
* binascii.crc32 in the standart Python library
* pycrc (http://www.tty1.net/pycrc)
* crcmod (http://pypi.python.org/pypi/crcmod)
Raw data
{
"_id": null,
"home_page": "http://code.google.com/p/pycrc16",
"name": "crc16",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "CRC16",
"author": "Gennady Trafimenkov",
"author_email": "gennady.trafimenkov@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a6/e0/70a44c4385f2b33df82e518005aae16b5c1feaf082c73c0acebe3426fc0a/crc16-0.1.1.tar.gz",
"platform": "UNKNOWN",
"description": "====================================\nPython library for calculating CRC16\n====================================\n\nCRC is a way of detecting accidental changes in data storage or\ntransmission. There are many variants of CRC and CRC16, in particular.\nThis library calculates only CRC16 (16-bit codes) and the only supported\nvariant at the moment is CRC-CCITT (XModem).\n\nIf you want to know more about CRC,\nhttp://wikipedia.org/wiki/Cyclic_redundancy_check is a good place to start.\n\nIf you want other variants of CRC16 supported, please make a request at\nhttp://code.google.com/p/pycrc16/issues\n\nSource codes are hosted at https://github.com/gennady/pycrc16\nIf you want to contribute to this library, create a fork, make you changes\nand then create a pull request. Any help is appreciated.\n\n------------\nInstallation\n------------\n\nOn Windows you can use precompiled binaries which can be found at\nhttp://code.google.com/p/pycrc16/downloads\n\nOn Linux and other operation systems you should compile the library from\nthe source codes. To do this on Linux use following steps:\n\n* download source tarball, e.g. crc16-0.1.1.tar.gz,\n from http://code.google.com/p/pycrc16/downloads\n\n* extract it with command::\n\n tar -xzf crc16-0.1.1.tar.gz\n\n* compile and install the library::\n\n cd crc16-0.1.1\n python setup.py build\n sudo python setup.py install\n\n you will need the administrative privileges to execute the last\n command.\n\nAfter installation you can run unit tests to make sure that the library\nworks fine. Execute::\n\n python -m crc16.test\n\n-----\nUsage\n-----\n\nIn Python 3::\n\n import crc16\n print(crc16.crc16xmodem(b'123456789'))\n\nIn Python 2 you should use strings instead of binary data::\n\n import crc16\n print(crc16.crc16xmodem('123456789'))\n\nYou can also calculate CRC gradually::\n\n import crc16\n crc = crc16.crc16xmodem(b'1234')\n crc = crc16.crc16xmodem(b'56789', crc)\n print(crc)\n\n--------------\nOther projects\n--------------\n\nThere are a number of projects and libraries for CRC calculation.\nSee for example:\n\n* binascii.crc32 in the standart Python library\n\n* pycrc (http://www.tty1.net/pycrc)\n\n* crcmod (http://pypi.python.org/pypi/crcmod)",
"bugtrack_url": null,
"license": "LGPL",
"summary": "Library for calculating CRC16",
"version": "0.1.1",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "http://code.google.com/p/pycrc16"
},
"split_keywords": [
"crc16"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a6e070a44c4385f2b33df82e518005aae16b5c1feaf082c73c0acebe3426fc0a",
"md5": "3cb6a4f5fd10a58c09792e321cc467e5",
"sha256": "c1f86aa0390f4baf07d2631b16b979580eae1d9a973a826ce45353a22ee8d396"
},
"downloads": -1,
"filename": "crc16-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "3cb6a4f5fd10a58c09792e321cc467e5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9631,
"upload_time": "2011-06-04T23:20:40",
"upload_time_iso_8601": "2011-06-04T23:20:40.620391Z",
"url": "https://files.pythonhosted.org/packages/a6/e0/70a44c4385f2b33df82e518005aae16b5c1feaf082c73c0acebe3426fc0a/crc16-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3c8a745b9c24ac19c6941e38ecf29ed3b2e564e796485426642c102fe84520c4",
"md5": "8de4344fd58143db6570ab6049db6d79",
"sha256": "eb47b9cec9818b684537d05552ff10404c92d9dcdd455156456b19e7423855bc"
},
"downloads": -1,
"filename": "crc16-0.1.1.win32-py2.6.exe",
"has_sig": false,
"md5_digest": "8de4344fd58143db6570ab6049db6d79",
"packagetype": "bdist_wininst",
"python_version": "2.6",
"requires_python": null,
"size": 208168,
"upload_time": "2011-06-04T23:23:03",
"upload_time_iso_8601": "2011-06-04T23:23:03.669961Z",
"url": "https://files.pythonhosted.org/packages/3c/8a/745b9c24ac19c6941e38ecf29ed3b2e564e796485426642c102fe84520c4/crc16-0.1.1.win32-py2.6.exe",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "62b4b6ee4d4019542ccac4eab0fec34da101235fce6b82128f146f933355ed06",
"md5": "9dcfeeae6896a93dc209e0d04ee7fe24",
"sha256": "7998bb0cacb0005ba62f963540c0f7cb09e86b51f6b4e64ed5632f31a7266fa1"
},
"downloads": -1,
"filename": "crc16-0.1.1.win32-py2.7.exe",
"has_sig": false,
"md5_digest": "9dcfeeae6896a93dc209e0d04ee7fe24",
"packagetype": "bdist_wininst",
"python_version": "2.7",
"requires_python": null,
"size": 208167,
"upload_time": "2011-06-04T23:22:45",
"upload_time_iso_8601": "2011-06-04T23:22:45.042339Z",
"url": "https://files.pythonhosted.org/packages/62/b4/b6ee4d4019542ccac4eab0fec34da101235fce6b82128f146f933355ed06/crc16-0.1.1.win32-py2.7.exe",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d9d732338df319b6b8845d0ae3b32a0bdb58ebbde76cf3dde3471f4cf7bd7ed6",
"md5": "a5a9cb57e68a88b6870402054efb496b",
"sha256": "1439e3cc0244a4758aa2d40a31b062086c24f5602046ec2fa4356484c4b5a385"
},
"downloads": -1,
"filename": "crc16-0.1.1.win32-py3.1.exe",
"has_sig": false,
"md5_digest": "a5a9cb57e68a88b6870402054efb496b",
"packagetype": "bdist_wininst",
"python_version": "3.1",
"requires_python": null,
"size": 208173,
"upload_time": "2011-06-04T23:22:39",
"upload_time_iso_8601": "2011-06-04T23:22:39.297724Z",
"url": "https://files.pythonhosted.org/packages/d9/d7/32338df319b6b8845d0ae3b32a0bdb58ebbde76cf3dde3471f4cf7bd7ed6/crc16-0.1.1.win32-py3.1.exe",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "33cce338915627c0b148c378ae249105e37efe31f70b1fb7d84e81f3c88a6dab",
"md5": "4a51f1f6f9c9b827c51554f14643db59",
"sha256": "521643768ff000a7758bc1f1c5e1dc41ae64b42fa57c50e133ab083cfaf9b8f9"
},
"downloads": -1,
"filename": "crc16-0.1.1.win32-py3.2.exe",
"has_sig": false,
"md5_digest": "4a51f1f6f9c9b827c51554f14643db59",
"packagetype": "bdist_wininst",
"python_version": "3.2",
"requires_python": null,
"size": 208169,
"upload_time": "2011-06-04T23:19:07",
"upload_time_iso_8601": "2011-06-04T23:19:07.096410Z",
"url": "https://files.pythonhosted.org/packages/33/cc/e338915627c0b148c378ae249105e37efe31f70b1fb7d84e81f3c88a6dab/crc16-0.1.1.win32-py3.2.exe",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "477388a4a3fe1270d36789e34ac21550b21693195251f80191cee149da1b073c",
"md5": "942c5b89ba301333a235c97ece073cc0",
"sha256": "63db8577ce0e03b39f30071166c6667659124a65d7fcd38adffe6a34487ce6fb"
},
"downloads": -1,
"filename": "crc16-0.1.1.win32-py3.3.exe",
"has_sig": false,
"md5_digest": "942c5b89ba301333a235c97ece073cc0",
"packagetype": "bdist_wininst",
"python_version": "3.3",
"requires_python": null,
"size": 202750,
"upload_time": "2013-03-11T21:45:18",
"upload_time_iso_8601": "2013-03-11T21:45:18.143778Z",
"url": "https://files.pythonhosted.org/packages/47/73/88a4a3fe1270d36789e34ac21550b21693195251f80191cee149da1b073c/crc16-0.1.1.win32-py3.3.exe",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "27f844fab1c8f71faafa1e5bbbb6e38102779846eb17d0e71885e952a5db3d28",
"md5": "9a3ba41c8f8377bb56b8e570c5c7a514",
"sha256": "1b9f697a93491ae42ed653c1e78ea25a33532afab87b513e6890975450271a01"
},
"downloads": -1,
"filename": "crc16-0.1.1.zip",
"has_sig": false,
"md5_digest": "9a3ba41c8f8377bb56b8e570c5c7a514",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 20883,
"upload_time": "2011-06-04T23:19:03",
"upload_time_iso_8601": "2011-06-04T23:19:03.604946Z",
"url": "https://files.pythonhosted.org/packages/27/f8/44fab1c8f71faafa1e5bbbb6e38102779846eb17d0e71885e952a5db3d28/crc16-0.1.1.zip",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2011-06-04 23:20:40",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "crc16"
}