Modbus CRC-16
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.3
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
$ python -m unittest discover -v -p "tests.py"
Release files for modbus-crc 1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| modbus-crc-1.3.tar.gz | 3.7 kB | Details |
Release files / modbus-crc-1.3.tar.gz
| Download URL | modbus-crc-1.3.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c860d8443d9a416bb1bb45e853c6f93a0500e759204ca24c24ab3b4f942c862c
|
|
BLAKE2b-256 checksum How to use checksums |
11f52368f483dbcb1df7be9cc9e153c4baecbeb15c74525a2ee05e96ed0566b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.6
|