Skip to main content

A pure-python implementation of the Damm Algorithm in Base 32.

Project description

Damm32

CircleCI Maintainability Test Coverage

Python implementation of the Damm Algorithm in Base 32

By default, it uses an alphabet as specified in RFC 4648 which contains 32 alphanumeric characters, with similar looking characters removed. The padding symbol is not included.

Installation

The package is available on PyPI and can be installed using pip: pip install damm32

It is also available on the Arch User Repository as python-damm32.

Alternatively, you can clone the repository and use the module.

Usage

The module contains a single class called Damm32, this class implements the methods for the checksum.

from damm32 import Damm32

d32 = Damm32()

digit = d32.calculate("HELLO")

d32.verify("HELLO" + digit)

You can also pass an list of length 32 to the constructor for the class to specify your alphabet.

from damm32 import Damm32

d32 = Damm32(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '2', '3', '4', '5', '6', '7'])

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

damm32-1.2.0.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

damm32-1.2.0-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page