Skip to main content
Python Package Version on Pypi Downloads from Pypi

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

  • v0.2.0 - add reset() by henriksod

  • v0.1.0 - add option to select initial polynom by FevGeb

  • v0.0.5 - document license

  • v0.0.4 - choose MIT license

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)

Source distribution for crc8 0.2.1
File Size Uploaded
crc8-0.2.1.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for crc8 0.2.1
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

1 release file

0.1.0

1 release file

0.0.5

1 release file

0.0.4

5 release files

0.0.3

5 release files

0.0.2

3 release files

0.0.1

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page