anycrc is a Python library providing extremely fast CRC (Cyclic Redundancy Check) calculations. It leverages hardware acceleration on Intel (SSE4.2, AVX512) and Arm (ARMv8-CRC) processors for significant speedups, claiming up to 10x faster than previous versions. The current version is 2.0.0, maintaining an active development pace with notable updates for performance and Python version compatibility.
pip install anycrcVerified import paths — ran on the pinned version, not inferred.
Initialize a CRC algorithm object and then use its `calc()` method to compute the checksum for byte-like data.
Update your code to instantiate CRC algorithms as objects (e.g., `c = crc.crc32_mpeg2()`) and then call the `calc()` method on the instance (e.g., `c.calc(data)`). Refer to the official documentation or GitHub README for updated API usage.
Upgrade your Python environment to version 3.8 or newer to use current `anycrc` releases.
No action is strictly required as the library gracefully falls back. However, for maximum performance, ensure the application runs on hardware with the specified CRC acceleration instructions. No user-level configuration is available to force hardware acceleration.
Ensure you are importing `crc` as `from anycrc import crc` and then instantiating the specific CRC algorithm, e.g., `c = crc.crc32_mpeg2()`.
First create an instance of the CRC algorithm: `c = crc.crc32_mpeg2()`, then call `calc()` on that instance: `checksum = c.calc(data)`.
Convert your string to bytes using `.encode()` or prefix it with `b` (e.g., `b"my string"`) before passing it to `calc()`.
No dependency data recorded yet.