PyCRC
What is PyCRC?
PyCRC is a python 3 library for CRC Calculations.
This is an intended port to python for lib_crc library. It's pure python implementation and it's not using any C library under the hood.
For a python 2.7 version go for the old repository
Where to get it from?
How to use it?
The CRC Modules are designed to be used separately. For a more throughout example, check included demo.py file.
from PyCRC.CRC16 import CRC16 input = '12345' print(CRC16().calculate(input))
For the latest complete documentation you might find useful readthedocs link.
What CRC Modules are available?
CRC Module | Python Module | Description |
---|---|---|
CRC16 | CRC16.py | for CRC16 and CRC16 Modbus |
CRC32 | CRC32.py | for CRC32 |
CRC16Kermit | CRC16Kermit.py | for CRC-CCITT (Kermit) |
CRC16SICK | CRC16SICK.py | for CRC16 (Sick) |
CRC16DNP | CRC16DNP.py | for CRC-DNP |
CRCCCITT | CRCCCITT.py | for CRC-CCITT (XModem), CRC-CCITT (0xFFFF) and CRC-CCITT (0x1D0F) |