#alphabet #algorithm #check #calculate #digits #damm #bases-alphabets

dammcheck

Implementation of the Damm Algorithm in various bases/alphabets

3 releases

0.1.2 Oct 3, 2023
0.1.1 Oct 3, 2023
0.1.0 Oct 3, 2023

#1147 in Algorithms

34 downloads per month

Custom license

120KB
2.5K SLoC

Dammcheck

Implementation of the Damm Algorithm in various bases/alphabets.

Usage

import dammcheck

# List available built-in alphabets
dammcheck.builtin_alphabets()

# Calculate the Damm check digit using a built-in alphabet
dammcheck.damm("ABC", alphabet="base32crockford")

# Or a custom alphabet
dammcheck.damm("TATA", custom_alphabet="ACGT")

Dependencies

~2.6–8.5MB
~70K SLoC