niccokunzmann / crc8

A module with the CRC8 algorithm for Python 2 and 3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

crc8

Build Status 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'

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/*

About

A module with the CRC8 algorithm for Python 2 and 3

License:MIT License


Languages

Language:Python 100.0%