Registry / serialization / crccheck

crccheck

JSON →
library1.3.1pypypi✓ verified 24d ago

crccheck is a Python library (currently v1.3.1) for calculating various Cyclic Redundancy Checks (CRCs) and checksums from binary data. It includes over 170 CRC algorithms and simple additive/XOR checksums. The library maintains an active, though somewhat irregular, release schedule, with recent updates adding new CRC algorithms.

pip install crccheck
INSTALL
IMPORT
SIG · CRCCHECK
C
crccheck
serializationpythonv1.3.1
Install
1.5s avg
Import
11ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.3.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.012s · 18MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.006s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Crc32
from crccheck.crc import Crc32
Checksum8
from crccheck.checksum import Checksum8
Crc
from crccheck.crc import Crc
Use the general Crc class for custom CRC parameters not pre-implemented.

Demonstrates how to perform a quick CRC calculation on a single data block and how to process multiple data blocks sequentially. Input data should be in bytes or bytearray format.

from crccheck.crc import Crc32 data_bytes = bytearray.fromhex("DEADBEEF01020304") # Quick calculation for a single data block calculated_crc = Crc32.calc(data_bytes) print(f"CRC-32 for {data_bytes.hex()}: {calculated_crc:08X}") # Calculation over multiple data blocks multi_block_data1 = b"Hello" multi_block_data2 = b"World" crc_instance = Crc32() crc_instance.process(multi_block_data1) crc_instance.process(multi_block_data2) final_crc = crc_instance.final() print(f"CRC-32 for multiple blocks: {final_crc:08X}")
Debug
Known issues
breakingOlder versions (prior to v0.3) had a different package name (not specified but taken on PyPI) and used `bigendian=True/False` arguments. These were changed to `crccheck` and `byteorder='big'/'little'` respectively.
fix
Ensure your code uses `crccheck` for imports and `byteorder='big'` or `byteorder='little'` for endianness specification.
affects: <0.3
gotchaInput data for CRC and checksum calculations must be binary (bytes or bytearray) in Python 3. Passing a regular string will result in a TypeError or incorrect results, as the library operates on byte sequences.
fix
Convert string data to bytes using `your_string.encode('utf-8')` or `bytearray.fromhex('...')` before passing it to `crccheck` functions.
affects: All versions (Python 3)
gotchaThe `calc()` class method is suitable for quick calculations on a single complete data block. For calculations involving multiple sequential data blocks, you must instantiate the CRC/checksum class, feed data using `process()`, and retrieve the final result with `final()`.
fix
For fragmented or streaming data, use an instance: `crc_inst = Crc32(); crc_inst.process(block1); crc_inst.process(block2); final_crc = crc_inst.final()`.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'crccheck'
The 'crccheck' library is not installed in your Python environment.
fix
pip install crccheck
TypeError: a bytes-like object is required, not 'str'
The crccheck library functions, such as `calc()`, expect binary data (bytes or bytearray) as input, but a regular Python string was provided.
fix
Convert your string data to bytes using `your_string.encode('utf-8')` or `bytes(your_string, 'utf-8')` before passing it to crccheck functions.
from crc import Crc32
This import statement incorrectly assumes 'crc' is a top-level package or module directly containing 'Crc32'. The 'Crc32' class is located within the 'crccheck.crc' subpackage.
fix
Use the correct import path: `from crccheck.crc import Crc32`.
Upgrade
Version history
1.3.1latest on PyPI · released Jul 10, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
Resources
crccheck — pip install crccheck · libregistry