Annex 2
ISBT 128 check character calculation
ISBT 128 donation numbers utilise check characters based on the ISO 7064 modulus 37,2 algorithm. This annex shows how to calculate the check character for a given number. The calculation is based on the donation number string excluding the leading ‘=’ symbol and the flag characters.
To calculate the ISBT check character:
- For each character in the string, determine its check value as required by ISO 7064 (see Table A2.1).
- For each character in the string, determine its weighted check value by multiplying the check value from step 1 by the nth power of 2, where n is the position of the character from the right-hand end of the string.
- Sum the weighted values from step 2.
- Find the modulus 37 value of the value from step 3.
- Subtract the value obtained in step 4 from 38.
- Find the modulus 37 value of the result of step 5. This is the 37,2 checksum.
- Calculate the barcode check character by adding 60 to the 37,2 checksum. The eye-readable check character can be determined by cross-referencing the 37,2 checksum value to the characters in Table A2.1.
Character | Value |
---|---|
0 | 0 |
1 | 1 |
2 | 2 |
3 | 3 |
4 | 4 |
5 | 5 |
6 | 6 |
7 | 7 |
8 | 8 |
9 | 9 |
A | 10 |
B | 11 |
C | 12 |
D | 13 |
E | 14 |
F | 15 |
G | 16 |
H | 17 |
I | 18 |
J | 19 |
K | 20 |
L | 21 |
M | 22 |
N | 23 |
O | 24 |
P | 25 |
Q | 26 |
R | 27 |
S | 28 |
T | 29 |
U | 30 |
V | 31 |
W | 32 |
X | 33 |
Y | 34 |
Z | 35 |
* | 36 |
Example of check character calculation
The following is a worked example for donation number G123 498 654 321.
Step 1 – determine each character's check value
Using Table A2.1, each character in the donation number has the following check value:
- G =16
- 1 = 1
- 2 = 2
- 3 = 3
- 4 = 4
- 9 = 9
- 8 = 8
- 6 = 6
- 5 = 5
- 4 = 4
- 3 = 3
- 2 = 2
- 1 = 1
Step 2 – determine each character's weighted value
Each character's check value is multiplied by 2^n, where n is its position from the right of the string:
Character | Check value | Position from right | 2^n | Weighted value |
---|---|---|---|---|
G | 16 | 13 | 2^13 = 8192 | 16 × 8192 = 131072 |
1 | 1 | 12 | 2^12 = 4096 | 1 × 4096 = 4096 |
2 | 2 | 11 | 2^11 = 2048 | 2 × 2048 = 4096 |
3 | 3 | 10 | 2^10 = 1024 | 3 × 1024 = 3072 |
4 | 4 | 9 | 2^9 = 512 | 4 × 512 = 2048 |
9 | 9 | 8 | 2^8 = 256 | 9 × 256 = 2304 |
8 | 8 | 7 | 2^7 = 128 | 8 × 128 = 1024 |
6 | 6 | 6 | 2^6 = 64 | 6 × 64 = 384 |
5 | 5 | 5 | 2^5 = 32 | 5 × 32 = 160 |
4 | 4 | 4 | 2^4 = 16 | 4 × 16 = 64 |
3 | 3 | 3 | 2^3 = 8 | 3 × 8 = 24 |
2 | 2 | 2 | 2^2 = 4 | 2 × 4 = 8 |
1 | 1 | 1 | 2^1 = 2 | 1 × 2 = 2 |
Step 3 – sum the weighted values
Σ (weighted values) = 148354
Step 4 – find the modulus 37 value of the sum of weighted values
148354 (mod 37) = 21
Step 5 – subtract the modulus 37 value from 38
38 - 21 = 17
Step 6 – find the modulus 37 value of the result
17 (mod 37) = 17
Step 7 – determine the barcode check character by adding 60
17 + 60 = 77
Result
ISBT 128 barcode check character = 77
ISBT 128 eye-readable character = H (value 17 in Table A2.1)