Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/stdnum
diff options
context:
space:
mode:
Diffstat (limited to 'stdnum')
-rw-r--r--stdnum/damm.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/stdnum/damm.py b/stdnum/damm.py
index b37c08c..9f36e40 100644
--- a/stdnum/damm.py
+++ b/stdnum/damm.py
@@ -38,6 +38,19 @@ InvalidChecksum: ...
'4'
>>> validate('5724')
'5724'
+>>> table = (
+... (0, 2, 3, 4, 5, 6, 7, 8, 9, 1),
+... (2, 0, 4, 1, 7, 9, 5, 3, 8, 6),
+... (3, 7, 0, 5, 2, 8, 1, 6, 4, 9),
+... (4, 1, 8, 0, 6, 3, 9, 2, 7, 5),
+... (5, 6, 2, 9, 0, 7, 4, 1, 3, 8),
+... (6, 9, 7, 3, 1, 0, 8, 5, 2, 4),
+... (7, 5, 1, 8, 4, 2, 0, 9, 6, 3),
+... (8, 4, 6, 2, 9, 5, 3, 0, 1, 7),
+... (9, 8, 5, 7, 3, 1, 6, 4, 0, 2),
+... (1, 3, 9, 6, 8, 4, 2, 7, 5, 0))
+>>> checksum('816', table=table)
+9
"""
from stdnum.exceptions import *