The Damm algorithm is a check-digit scheme that appends a single decimal digit to a number so that typos can be caught. Published by H. Michael Damm in 2004, it is built on a totally antisymmetric quasigroup of order 10 — a carefully constructed 10×10 table. Its big advantage over older schemes is that it detects all single-digit errors and all adjacent transposition errors while using only one ordinary decimal digit, so there is never a need for an extra symbol like the X used by ISBN-10.
How it works
The algorithm walks the digits through a fixed 10×10 lookup table:
- Initialise an interim value to
0. - For each digit
dof the number, replace the interim value withtable[interim][d]. - After processing every digit, the result is the new interim value.
To generate a check digit, run steps 1–2 over the payload digits only; the final interim value is the check digit you append. To validate, run the process over the full number (payload plus check digit) — the number is valid if and only if the final interim value is 0.
Example
Take the payload 572. Running it through the standard table gives a final interim value of 4, so the protected number is 5724. Validating 5724 walks all four digits and ends at interim 0, confirming it is valid. Changing any single digit, or swapping two adjacent digits, will end at a non-zero interim value and be rejected.
All processing is local to your browser — nothing is uploaded.