The crc package provides provides support for the most common functionality to handle and calculate various kinds of crc checksums. (e.g. Crc8, Crc16, Crc32)
TBD
- Python 3.6 and newer
data = [0, 1, 2, 3, 4, 5 ]
expected_checksum = 0xff
crc_calculator = CrcCalculator(Crc8.CCITT)
checksum = crc_calculator.calculate_checksum(data)
assert checksum == expected_checksum
assert crc_calculator.verfify_checksum(data, expected_checksum)
data = [0, 1, 2, 3, 4, 5 ]
expected_checksum = 0xff
crc_calculator = CrcCalculator(Crc8.CCITT)
data = [0, 1, 2, 3, 4, 5 ]
expected_checksum = 0xff
crc_calculator = CrcCalculator(Crc8.CCITT)
data = [0, 1, 2, 3, 4, 5 ]
expected_checksum = 0xff
crc_calculator = CrcCalculator(Crc8.CCITT)
data = [0, 1, 2, 3, 4, 5 ]
expected_checksum = 0xff
crc_calculator = CrcCalculator(Crc8.CCITT)
.. code-block::
data = [0, 1, 2, 3, 4, 5 ]
expected_checksum = 0xff
crc_calculator = CrcCalculator(Crc8.CCITT)
name: crc.cli.command description: TBD
A set of crc checksum related command line tools.
usage:
crc [--version][--help] <command> [<args>...]
options:
-h, --help prints this help dialoge
--version version
commands:
table creates a crc lookup table.
verfiy verfies a already calcualted crc for the specified data.
calcualte calculates the crc checksum for the specified data.
Command line tool to create crc lookup tables.
usage:
crc table [options] <width> <polynom>
arguments:
<polynom> hex value of the polynom used for calculating the crc table.
options:
-h, --help
--version
Info: Main code -> crc.py works without any dependencies -> copy and paste into project but gererally highly recommend -> install using pip -> tests etc