Skip to main content

CRC-16 calculation for Modbus protocol

Reason this release was yanked:

broken package

Project description

Modbus CRC-16

License Downloads Latest Version Supported Python versions

CRC-16 calculation library for Modbus protocol

Installation

Install it with pip:

$ pip install modbus-crc

Or you can add it as dependency in requirements.txt file of your python application:

modbus-crc~=1.1

Usage

For signing byte package use add_crc:

from modbus_crc import add_crc

signed_package = add_crc(b'\x00\x12\x34\xAB\xCD\xEF')

Result is b'\x00\x12\x34\xAB\xCD\xEF\xD2\xD4. For validation signed package use check_crc:

from modbus_crc import check_crc

if not check_crc(b'\x00\x12\x34\xAB\xCD\xEF\xD2\xD4'):
    raise SomeException()

Testing

Use tox for testing

$ pip install tox
$ tox

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

modbus-crc-1.1.tar.gz (2.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page