A module that implements the CRC8 hash algorithm for Python 2 and 3.
Installation
pip install crc8
Or copy the crc8.py file somewhere where you can import it.
Usage
The crc8 class has the same interface as the hash functions in the hashlib module.
Example:
import crc8
hash = crc8.crc8()
hash.update(b'123')
assert hash.hexdigest() == 'c0'
assert hash.digest() == b'\xc0'
hash.reset()
assert hash.hexdigest() == '00'
You can also use the method chaining syntax:
import crc8
hash = crc8.crc8()
result = hash.reset().update(b'123').hexdigest()
assert result == 'c0'
Contribute
If something s not there that you would like to have, open an issue, create a pull request.
The license is MIT and I value contributions if you modify the code.
Changelog
Release
Install twine.
python setup.py sdist
source .env # if you have stored TWINE_USERNAME and TWINE_PASSWORD
twine upload dist/*
Release files for crc8 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| crc8-0.2.1.tar.gz | 6.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| crc8-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.6 kB
Release files / crc8-0.2.1.tar.gz
| Download URL | crc8-0.2.1.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2ea9e0a04fbb9621daf278da7cba0c11e5fc2f7af74d44d35e08832d3a7a4d23
|
|
BLAKE2b-256 checksum How to use checksums |
914aaeba5e1ddd6f1035f634899a1fa133c9d57156d392386859e0cf84c1d62b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Release files / crc8-0.2.1-py3-none-any.whl
| Download URL | crc8-0.2.1-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0c7cc1e442f4e5227a4f1b83a025454fd2d575177c7f78f35814580c7ffd073a
|
|
BLAKE2b-256 checksum How to use checksums |
d8f86d922e3fb4b175f105150992c62aac05bb0cfe41fb138f9afda5a27f838f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|