{"id":15297009,"url":"https://github.com/gardentools/crcengine","last_synced_at":"2025-04-13T22:12:03.289Z","repository":{"id":40696145,"uuid":"219177365","full_name":"GardenTools/CrcEngine","owner":"GardenTools","description":"A Python CRC library for calculation and C-code generation","archived":false,"fork":false,"pushed_at":"2024-02-21T19:50:45.000Z","size":343,"stargazers_count":9,"open_issues_count":4,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T17:42:40.592Z","etag":null,"topics":["c","checksum","checksum-calculation","checksum-generation","crc","crc-algorithms","crc16","crc32","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GardenTools.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-11-02T16:00:04.000Z","updated_at":"2025-02-04T08:43:54.000Z","dependencies_parsed_at":"2023-01-31T02:00:26.442Z","dependency_job_id":"8ef034cc-fa77-4d71-adf5-5da34c1a6a41","html_url":"https://github.com/GardenTools/CrcEngine","commit_stats":{"total_commits":113,"total_committers":3,"mean_commits":"37.666666666666664","dds":0.327433628318584,"last_synced_commit":"8aac7b98f239cead87549fb7e24de0299b840211"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GardenTools%2FCrcEngine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GardenTools%2FCrcEngine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GardenTools%2FCrcEngine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GardenTools%2FCrcEngine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GardenTools","download_url":"https://codeload.github.com/GardenTools/CrcEngine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248788917,"owners_count":21161728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","checksum","checksum-calculation","checksum-generation","crc","crc-algorithms","crc16","crc32","python","python3"],"created_at":"2024-09-30T19:14:06.963Z","updated_at":"2025-04-13T22:12:03.248Z","avatar_url":"https://github.com/GardenTools.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. image:: https://img.shields.io/pypi/v/crcengine.svg\n        :target: https://pypi.python.org/pypi/crcengine\n\n..  image:: https://img.shields.io/github/actions/workflow/status/GardenTools/CrcEngine/python-package.yml\n        :target: https://github.com/GardenTools/CrcEngine/actions?query=branch%3Amaster\n\n.. image:: https://img.shields.io/pypi/pyversions/CrcEngine.svg\n        :target: https://pypi.python.org/pypi/crcengine\n\n.. image:: https://img.shields.io/pypi/format/CrcEngine.svg\n        :target: https://pypi.python.org/pypi/crcengine\n\n.. image:: https://readthedocs.org/projects/crcengine/badge/?version=latest\n        :target: https://crcengine.readthedocs.io/en/latest/?badge=latest\n        :alt: Documentation Status\n\n==========\nCrcEngine\n==========\nA python library for CRC calculation providing table-based as well as\nbit-bashing implementations (for reference).\n\n* Free software: GNU General Public License v3\n* Documentation: https://crcengine.readthedocs.io.\n\nInstalling\n----------\nCrcEngine can be installing using pip with\n\n.. code-block:: python\n\n    pip install crcengine\n\nUsage\n-----\nPre-defined algorithms such as CRC32 are available. Tailored algorithms can\nbe created by calling CrcEngine.create() and other related methods.\n\nA calculation engine for a specific named algorithm can be obtained using\nCrcEngine.new(). Algorithms which are not pre-defined can be created using\nCrcEngine.create() \n\nA list of pre-defined algorithms can be obtained using crcengine.algorithms_available()\n\n.. code-block:: python\n\n   \u003e\u003e\u003e list(crcengine.algorithms_available())\n   ['crc8', 'crc8-autosar', 'crc8-bluetooth', 'crc8-ccitt', 'crc8-gsm-b', 'crc8-sae-j1850', 'crc15-can', 'crc16-kermit', 'crc16-ccitt-true', 'crc16-xmodem', 'crc16-autosar', 'crc16-ccitt-false', 'crc16-cdma2000', 'crc16-ibm', 'crc16-modbus', 'crc16-profibus', 'crc24-flexray16-a', 'crc24-flexray16-b', 'crc32', 'crc32-bzip2', 'crc32-c', 'crc64-ecma']\n\n\nBuilt-in algorithms\n~~~~~~~~~~~~~~~~~~~\ncrc8, crc8-autosar, crc8-bluetooth, crc8-ccitt, crc8-gsm-b, crc8-sae-j1850, crc15-can, crc16-kermit, crc16-ccitt-true, crc16-xmodem, crc16-autosar, crc16-ccitt-false, crc16-cdma2000, crc16-ibm, crc16-modbus, crc16-profibus, crc24-flexray16-a, crc24-flexray16-b, crc32, crc32-bzip2, crc32-c, crc64-ecma\n\nExamples\n--------\nUsing a pre-defined algorithm\n\n.. code-block:: python\n\n  import crcengine\n  crc_algorithm = crcengine.new('crc32-bzip2')\n  result = crc_algorithm(b'123456789')\n  print('CRC=0x{:08x}'.format(result))\n\nOutput:\n\u003e CRC=0xfc891918\n\nDefining an algorithm\n\n.. code-block:: python\n\n  import crcengine\n  params = crcengine.CrcParams(0x864cfb, 24, 0xb704ce, reflect_in=False, reflect_out=False, xor_out=0)\n  crc_openpgp = crcengine.create_from_params(params)\n  # this is equivalent to\n  crc_openpgp = crcengine.create(params=params)\n  # invocation\n  result = crc_openpgp(b'123456789')\n  print(f'CRC=0x{result:08x}')\n\nWhen using create() `params` must be passed as a keyword parameter, since the function also accepts polynomial and seed\nparameters for backwards compatibility.\n\nCode Generation\n---------------\nThe library can generate C code for a given table-algorithm. The code produced\nis intended to be a reasonable compromise between size, complexity and speed\nwithout requiring allocation of memory for table generation at runtime.\n\nFaster implementations of specific algorithms can be achieved in software which\nunroll loops and pipeline the operations different bytes to introduce\nparallelism in the calculation see intel_soft_src_ for example. Some processors\nalso include instructions specifically for crc calculation.\n\n.. _intel_soft_src: https://github.com/intel/soft-crc\n\nCode Generation Example usage:\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nGenerating code into a directory named \"out\" by passing CRC parameters\n\n.. code-block:: python\n\n    params = crcengine.get_algorithm_params('crc32')\n    crcengine.generate_code(params, 'out/')\n\nor referencing the algorithm by name\n\n.. code-block:: python\n\n    crcengine.generate_code('crc16-xmodem', 'out/')\n\n\nDownloading\n-----------\n- The source is available on github_\n- Git clone crcengine.git_\n- On pypi.org_\n\n.. _github: https://github.com/GardenTools/crcengine\n.. _crcengine.git: https://github.com/GardenTools/crcengine.git\n.. _pypi.org: https://pypi.org/project/crcengine/\n\nRunning the tests\n-------------------------\nTests can be performed directly by executing pytest in the \"tests\" directory\n\nRunning the Codegen tests\n-------------------------\nThe codegen tests make use of ceedling_ which is expected to be installed as a ruby gem.\nThe unit tests are configured to compile with gcc.\n\n.. _ceedling: https://github.com/ThrowTheSwitch/Ceedling\n\n-------\n\nWith thanks to Greg Cook for providing such a thoroughly collated list of\n`CRC definitions`_\n\n.. _CRC definitions: http://reveng.sourceforge.net/crc-catalogue/all.htm\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgardentools%2Fcrcengine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgardentools%2Fcrcengine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgardentools%2Fcrcengine/lists"}