Damm algorithm: Difference between revisions

Content deleted Content added
fmt
 
(13 intermediate revisions by 9 users not shown)
Line 1:
{{Short description|Check digit algorithm}}
In [[error detection]], the '''Damm algorithm''' is a [[check digit]] [[algorithm]] that detects all [[Transcription error|single-digit errors]] and all [[Transcription error#Transposition error|adjacent transposition errors]]. It was presented by H. Michael Damm in 2004.,<ref name="fenwick2014" /> as a part of his PhD dissertation entitled ''Totally Antisymmetric Quasigroups.''
 
== Strengths and weaknesses ==
Line 42 ⟶ 43:
== Example ==
The following operation table will be used.<ref name="fenwick2014" /> It may be obtained from the totally anti-symmetric quasigroup {{math|''x'' ∗ ''y''}} in Damm's doctoral dissertation page 111<ref name="dhmd" /> by rearranging the rows and changing the entries with the permutation {{math|1=''φ'' = (1&nbsp;2&nbsp;9&nbsp;5&nbsp;4&nbsp;8&nbsp;6&nbsp;7&nbsp;3)}} and defining {{math|1=''x'' ⋅ ''y'' = ''φ''<sup>&minus;1</sup>(''φ''(''x'') ∗ ''y'')}}.
{| class="skin-invert wikitable" style="text-align:center;background:none;color:#E000E0"
|- style="color:#00A000"
|style="width:1.5em"| {{math|1=⋅}}
Line 89 ⟶ 90:
 
=== Calculating the check digit ===
{| class="skin-invert wikitable" style="text-align:center;background:none;color:#E000E0"
|- style="color:#00A000"
!style="color:black"| <span style="color:#00A000">digit to be processed</span> → column index
Line 109 ⟶ 110:
 
=== Validating a number against the included check digit ===
{| class="skin-invert wikitable" style="text-align:center;background:none;color:#E000E0"
|- style="color:#00A000"
!style="color:black"| <span style="color:#00A000">digit to be processed</span> → column index
Line 115 ⟶ 116:
|style="width:1.5em"| 7
|style="width:1.5em"| 2
|
|style="width:1.5em"| 4
|-
Line 122:
| 9
| 7
|
| 4
|-
Line 129 ⟶ 128:
| 7
| 4
|
| '''0'''
|}
Line 157 ⟶ 155:
{{Wikibooks|Algorithm Implementation/Checksums/Damm Algorithm}}
*[[b:Algorithm Implementation/Checksums/Damm Algorithm|Damm validation & generation code in several programming languages]]
*[httphttps://blogwww.cantab-ip.com/blog/2014/01/20/new-format-for-singapore-ip-application-numbers-at-ipos/ Practical application in Singapore]
*[http://www.md-software.de/math/DAMM_Quasigruppen.txt Quasigroups for the Damm algorithm up to order 64]
*[https://rosettacode.org/wiki/Damm_algorithm At RosettaCode.org, Implementations of the Damm algorithm in many programming languages]