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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file damm32-1.2.0.tar.gz.

File metadata

  • Download URL: damm32-1.2.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/5.4.58-1-lts

File hashes

Hashes for damm32-1.2.0.tar.gz
Algorithm Hash digest
SHA256 9d6a864dbf1f5c2830fd81538f92eca9dd11666efb74a16c5d166d9ea521d7df
MD5 de6c9f1a7c235a787e4f932fec4bc260
BLAKE2b-256 ec38ee7c25673b83840fd21e286708275deba23c73901a960c7d0f9b0f0c5c13

See more details on using hashes here.

File details

Details for the file damm32-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: damm32-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/5.4.58-1-lts

File hashes

Hashes for damm32-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f4b2e6255ba4ef9b1de057dd25429b7d01fccd83c319ed977583ff771b44cd7c
MD5 beef8806990647d258392a65d774bc25
BLAKE2b-256 8bad54a52a56aa14fa8118e284ed60caa53440f6b25034ce44360f809cc2b784

See more details on using hashes here.

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