
BoostCommit : 
Subject: [Boostcommit] svn:boost r72964  sandbox/SOC/2011/checks/libs/checks/doc
From: pierre.talbot.6114_at_[hidden]
Date: 20110708 10:01:28
Author: trademark
Date: 20110708 10:01:27 EDT (Fri, 08 Jul 2011)
New Revision: 72964
URL: http://svn.boost.org/trac/boost/changeset/72964
Log:
Modification of the transposition part.
Addition of explanation on the "length error".
Text files modified:
sandbox/SOC/2011/checks/libs/checks/doc/errors.qbk  17 ++++++++
1 files changed, 8 insertions(+), 9 deletions()
Modified: sandbox/SOC/2011/checks/libs/checks/doc/errors.qbk
==============================================================================
 sandbox/SOC/2011/checks/libs/checks/doc/errors.qbk (original)
+++ sandbox/SOC/2011/checks/libs/checks/doc/errors.qbk 20110708 10:01:27 EDT (Fri, 08 Jul 2011)
@@ 8,11 +8,11 @@
[h5 Single error]
If the digits are added, an alteration of one digit will render the sum different and therefore the check digit.
+If the digits are added, an alteration of one digit will always render a different sum and therefore the check digit.
[h5 Multiple error]
If more than one digit is altered, a simple sum can't ensure that the check digit will be different.
+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.
@@ 21,16 +21,15 @@
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.
The Luhn algorithm alternates a digit multiply by two and a simple digit. All twin transpositions are catched but the sequence "90" or "09" because:
+[note A transposition error is only catched 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.]
9*2 = 18 and 189 = 9 so 9*2 = 9
0*2 = 0
+[h4 Length]
The two digits have the same value if there are doubled or not.
+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 uncatched if the check digit of the new sequence of digit is equal to the last digit of this sequence.
[note A transposition is only catched if the two digits transposed have a different weight and their values with or without weight are not the same.]
+[h4 Shift]
[h4 Length]
[h4 Phonetic error]
+[h4 Phonetic]
[endsect][/section:errors Type of errors]
\ No newline at end of file
BoostCommit 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