Python script to calculate LPC firmware checksums
Python script to calculate LPC firmware checksums, based on the C version by Roel Verdult. It can be used as a standalone application, or as a Python module that integrates directly in a build environment (e.g. SCons). It does not need to be compiled.
The only requirement is Python 3.9 or newer.
This module can be installed from Pypi via pip install lpc_checksum
.
Alternatively, you can install the latest version by cloning this repository
and run python setup.py install
.
There are two ways of using lpc_checksum
.
When installed via Pip or from source, the command lpc_checksum
should be
available on your PATH. By default, it assumes the input file is a binary file.
lpc_checksum <firmware.bin|hex> [--format=bin] [--read-only]
Program exits with a non-zero error code when it failed.
import lpc_checksum
checksum = lpc_checksum.checksum(input_file, [read_only=True])
On error, an exception will be raised.
To run the tests, please clone this repository and run poetry run pytest
.
See the CONTRIBUTING.md
file.
See the LICENSE.md
file (MIT license).