In error detection, the Damm algorithm is a check digit algorithm that detects all singledigit errors and all adjacent transposition errors. It was presented by H. Michael Damm in 2004. Its essential part is a quasigroup of order 10 (i.e. having a 10×10 Latin square as operation table) with the special feature of being totally antisymmetric.^{[1]}^{[2]}^{[lowerroman 1]}^{[lowerroman 2]} Damm revealed several methods to create such totally antisymmetric quasigroups of order 10 and gave some examples in his doctoral dissertation.^{[1]}^{[lowerroman 1]} With this, Damm also disproved an old conjecture that totally antisymmetric quasigroups of order 10 do not exist.^{[3]}
Algorithm
The validity of a digit sequence containing a check digit is defined over a quasigroup. A quasigroup table ready for use can be taken from Damm's dissertation (pages 98, 106, 111).^{[1]} It is useful to use a totally antisymmetric quasigroup where each diagonal entry is 0, because it simplifies the check digit calculation.
Validating a number against the included check digit
 Set up an interim digit and initialize it to 0.
 Process the number digit by digit: Use the number's digit as column index and the interim digit as row index, take the table entry and replace the interim digit with it.
 The number is valid if and only if the resulting interim digit has the value of 0.
Calculating the check digit
Prerequisite: The diagonal entries of the table are 0.
 Set up an interim digit and initialize it to 0.
 Process the number digit by digit: Use the number's digit as column index and the interim digit as row index, take the table entry and replace the interim digit with it.
 The resulting interim digit gives the check digit and will be appended as trailing digit to the number.
Example
The totally antisymmetric quasigroup is taken from Damm's doctoral dissertation page 111.^{[1]} It is modified by rearranging the columns and changing the entries correspondingly. This does not work on all cases.
0  1  2  3  4  5  6  7  8  9  
0  0  3  1  7  5  9  8  6  4  2 
1  7  0  9  2  1  5  4  8  6  3 
2  4  2  0  6  8  7  1  3  5  9 
3  1  7  5  0  9  8  3  4  2  6 
4  6  1  2  3  0  4  5  9  7  8 
5  3  6  7  4  2  0  9  5  8  1 
6  5  8  6  9  7  2  0  1  3  4 
7  8  9  4  5  3  6  2  0  1  7 
8  9  4  3  8  6  1  7  2  0  5 
9  2  5  8  1  4  3  6  7  9  0 
Suppose we choose the number (digit sequence) 572.
Calculating the check digit
digit to be processed → column index  5  7  2 

old interim digit → row index  0  9  7 
table entry → new interim digit  9  7  4 
The resulting interim digit is 4. This is the calculated check digit. We append it to the number and obtain 5724.
Validating a number against the included check digit
digit to be processed → column index  5  7  2  4 

old interim digit → row index  0  9  7  4 
table entry → new interim digit  9  7  4  0 
The resulting interim digit is 0, hence the number is valid.
Graphical illustration
File:Check digit TA quasigroup dhmd111rr illustration eg5724.svg
Strengths and weaknesses
The Damm algorithm is similar to the Verhoeff algorithm. It too will detect all occurrences of altering one single digit and all occurrences of transposing two adjacent digits. (These are the two most frequently appearing types of transcription errors.)^{[4]} But the Damm algorithm has the benefit that it makes do without the dedicatedly constructed permutations and its position specific powers being inherent in the Verhoeff scheme. Furthermore, a table of inverses can be dispensed with provided all diagonal entries of the operation table are zero.
The Damm algorithm does not suffer from exceeding the number of 10 possible values, resulting in the need for using a nondigit character (as the X in the 10digit ISBN check digit scheme).
Prepending leading zeros does not affect the check digit.
There are totally antisymmetric quasigroups that detect all phonetic errors associated with the English language (13 ↔ 30, 14 ↔ 40, ..., 19 ↔ 90). The table used in the illustrating example above represents an instance of such kind.
Despite its desirable properties in typical contexts where similar algorithms are used, the Damm algorithm is largely unknown and scarcely used in practice.
References
 ↑ ^{1.0} ^{1.1} ^{1.2} ^{1.3} Damm, H. Michael (2004). Total antisymmetrische Quasigruppen (Dr. rer. nat.). PhilippsUniversität Marburg. urn:nbn:de:hebis:04z200405162. http://archiv.ub.unimarburg.de/diss/z2004/0516/pdf/dhmd.pdf.(German)
 ↑ Damm, H. Michael (2007). "Totally antisymmetric quasigroups for all orders n≠2,6". Discrete Mathematics 307 (6): 715–729. DOI:10.1016/j.disc.2006.05.033. ISSN 0012365X. http://www.sciencedirect.com/science/article/pii/S0012365X06004225.
 ↑ Damm, H. Michael (2003). "On the Existence of Totally AntiSymmetric Quasigroups of Order 4k + 2". Computing 70 (4): 349–357. DOI:10.1007/s0060700300173. ISSN 0010485X. http://link.springer.com/article/10.1007%2Fs0060700300173.
 ↑ Kirtland, Joseph (2001). Identification Numbers and Check Digit Schemes. Classroom Resource Materials. Mathematical Association of America. pp. 4–5. ISBN 9780883857205. http://books.google.com/books?id=npTxORxmLosC&pg=PA4.
 ↑ ^{1.0} ^{1.1} Beliavscaia Galina; Izbaş Vladimir; Şcerbacov Victor (2003). "Check character systems over quasigroups and loops". Quasigroups and Related Systems 10 (1): 1–28. ISSN 15612848. http://www.math.md/files/qrs/v10n1/v10n1(pp128).pdf. See page 23.
 ↑ Chen Jiannan (2009). "The NPcompleteness of Completing Partial antisymmetric Latin squares". Proceedings of 2009 International Workshop on Information Security and Application (IWISA 2009). Academy Publisher. pp. 322–324. ISBN 9789525726060. http://www.academypublisher.com/proc/iwisa09/papers/iwisa09p322.pdf. See page 324.
External links
Wikibooks has a book on the topic of
Algorithm Implementation/Checksums/Damm Algorithm </td>
</tr> </table>
