Subject: [Boost-commit] svn:boost r74364 - sandbox/SOC/2011/checks/libs/checks/doc
Date: 2011-09-12 17:02:59
Date: 2011-09-12 17:02:58 EDT (Mon, 12 Sep 2011)
New Revision: 74364
Text files modified:
sandbox/SOC/2011/checks/libs/checks/doc/errors.qbk | 40 +++++++++++++++++++++++++---------------
1 files changed, 25 insertions(+), 15 deletions(-)
--- sandbox/SOC/2011/checks/libs/checks/doc/errors.qbk (original)
+++ sandbox/SOC/2011/checks/libs/checks/doc/errors.qbk 2011-09-12 17:02:58 EDT (Mon, 12 Sep 2011)
@@ -10,48 +10,58 @@
[section:errors Type of errors]
This section will describe some common errors that an user or a device can make.
+It will also discuss the efficiency of the algorithms studied.
[h5 Single error]
-If the digits are added, an alteration of one digit will always render a different sum and therefore the check digit.
+The single error is always detected if the modulus is equal or greater than the
+range of the value in the number. For example, if an algorithm accept the values
+0 to 9 and A to Z (whether 36 different values), the modulus should be greater
+or equal than 36. If it's respected, the single error will be detected.
+The Verhoeff algorithm detects all single error.
[h5 Multiple error]
If more than one digit is altered, a simple sum can't ensure that the check digit will be different.
-In fact it depends on the compensation of the altered digits.
-For example : 1 + 2 + 3 = 6. If we alter 2 digits, the sum could become : 2 + 2 + 2 = 6. The result is equal because 1 + 3 = 2 + 2, the digits altered are compensated.
+In fact it depends on the compensation of the altered digits. For example : 1 + 2 + 3 = 6.
+If we alter 2 digits, the sum could become : 2 + 2 + 2 = 6. The result is equal because 1 + 3 = 2 + 2,
+the digits altered are compensated.
[endsect] [/section:alteration Alteration]
-A transposition on a simple sum is impossible to detect
-because the addition is commutative, the order is not important.
-A solution is to associate the position of a digit with a weight.
-[note A transposition error is only caught if the two digits transposed
+A transposition error is caught if the two digits transposed
have a different weight and if their values with their weight
-or the weight of the other digit are not the same.]
+or the weight of the other digit are not the same. For example,
+3*2 = 2*3 so a transposition of 2 and 3 with those weights
+is not detected.
[endsect] [/section:transposition Transposition]
The length is not often a problem because many codes and numbers have a fixed length.
-But if the user do not specify the size,
-an error could be uncaught if the check digit of
+But if the user do not specify the size, an error could be uncaught if the check digit of
the new sequence of digit is equal to the last digit of this sequence.
[endsect] [/section:length Length]
+[section: Observations and summary]
+# An error in the checksum is detected if | new_checksum - checksum | != modulus.
+# The assertion: "new_checksum == checksum" doesn't mean that the number is error-free.
+Digits can be compensated or the check digit altered.
-[endsect] [/section:shift Shift]
-[endsect] [/section:phonetic Phonetic]
+[table:summary Error catching summary
+[[1 Alteration] [2 Alterations] [Twin transpositions] ]
+[[Luhn] [18/18 (100%)]  [88/90 (97.78%)]]
+[[Verhoeff] [18/18 (100%)]  [90/90 (100%)]]
[endsect] [/section:errors Type of errors]
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk