D.Roos, J.Kardoeus: ISO7064-standardised Check Digits Applied to Blood Bag Numbers | release 1.1.1i (draft) | |
ISO7064-standardised Check Digits Applied to Blood Bag Numbers
|
MOD 11,10 algorithm (from ISO 7064[4]) |
This chapter can be skipped by readers, who are not interested
in the mathematics of check digit algorithms
The check digit is concatenated right-terminating to the original numerical string.
A numerical string having a check digit passes as "valid", that is "probably transmitted correctly", if it meets the condition as follows (see calculation example):
( | (( | ... | (( | ... | (( | (( | 10 | + a1)||10 * 2)|11 | + a2)||10 * 2)|11 | + ... | + aj)||10 * 2)|11 | + ... | + an-1)||10 * 2)|11 | + an)||10 | = | 1 | (1) | |
=T0 | =T1 | =T2 | =Tj | =Tn-1 | ||||||||||||||
Having:
Algorithmic steps
The brackets appearing in the check digit equation are calculated recursively starting with the inner-most and processing the source string from left (j=1) to right (j=n-1) (see calculation example). For that the intermediate results Tj are calculated recursively for j = 1, 2, ..., n-1 starting with T0=10:
If either a numerical string with check digit enclosed has to be validated or a check digit has to be attached to a source string the procedure continues alternatively as follows:
Validation
The numerical string is valid (that is "probably transmitted correct"), if Tn-1 from equation (2) is:
(Tn-1 + an)||10 =1 | (3) |
Check digit calculation (see calculation example)
The check digit an is calculated from Tn-1 using equation (2):
an = (11 - Tn-1)|10 | (4) |
having (...)|10 the remainder after deviding the term in brackets through 10.
Disclaimer | Copyright | last revision: 25.11.2000 21:46 |
Signature |