A module that implements the CRC8 hash algorithm for Python 2 and 3.
Project description
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/*
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crc8-0.2.1.tar.gz.
File metadata
- Download URL: crc8-0.2.1.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ea9e0a04fbb9621daf278da7cba0c11e5fc2f7af74d44d35e08832d3a7a4d23
|
|
| MD5 |
6d873cc0982c8a0b22174d0282e9a1e4
|
|
| BLAKE2b-256 |
914aaeba5e1ddd6f1035f634899a1fa133c9d57156d392386859e0cf84c1d62b
|
File details
Details for the file crc8-0.2.1-py3-none-any.whl.
File metadata
- Download URL: crc8-0.2.1-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c7cc1e442f4e5227a4f1b83a025454fd2d575177c7f78f35814580c7ffd073a
|
|
| MD5 |
285b406761c60e0e8935d3a28f2178a9
|
|
| BLAKE2b-256 |
d8f86d922e3fb4b175f105150992c62aac05bb0cfe41fb138f9afda5a27f838f
|