Guidelines for the Blood Transfusion
Services in the UK

Skip Navigation Links.
   Print friendly version

Annex 2

ISBT 128 check character calculation

ISBT 128 donation numbers utilize check characters based on the ISO 7064 Mod 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.

The steps in the process are as follows:

  1. For each character in the string determine its check value as required by ISO 7064 (see Table A2.1).
  2. For each character determine its weighted check value by multiplying the check value from (1) by the nth power of 2 where n is the position of the character from the right-hand end of the string.
  3. Sum the weighted check values from (2).
  4. Find the modulus 37 value of the sum from (3).
  5. Subtract the value obtained in (4) from 38.
  6. Find the modulus 37 value of the result of (5). This is the 37,2 check sum.

The calculated check sum is used to generate both the barcode check characters used in the flag positions of the ISBT 128 barcode and the eye-readable check character. The barcode check characters are determined by adding 60 to the check sum. The eye-readable check character is determined by cross-referencing the checksum to Table A2.1.

Table A2.1 Mapping from characters to ISO 7064 check values
Char 0123456789ABCD
Value 012345678910111213
 
Char EFGHIJKLMNOPQR
Value 1415161718192021222324252627
 
Char STUVWXYZ* 
Value 282930313233343536 
Table A2.2 Example of displayed numbers
Donation number G123 498 654 321
Position from right (n) 2n Character ISO7064 value (step 1) Weighted value (step 2)
13 8192 G 16 131072
12 4096 1 1 4096
11 2048 2 2 4096
10 1024 3 3 3072
9 512 4 4 2048
8 256 9 9 2304
7 128 8 8 1024
6 64 6 6 384
5 32 5 5 160
4 16 4 4 64
3 8 3 3 24
2 4 2 2 8
1 2 1 1 2
Step 3   Sum of weighted values   148354
Step 4   Sum mod 37   21
Step 5   Subtract from 38   17
Step 6   Mod 37   17
ISO 37,2 check sum = 17
ISBT128 barcode check characters 77
ISBT128 eye-readable check = H