4.3. Modulo 43 Checksum

Some applications, such as HIBC and LOGMARS, require a modulo 43 Check character at the end of the barcode (just before the stop character). The scanners must be configured with the checksum verification turned on in order to use the feature. The design of the checksum is to guard the data integrity. The scanner calculates the checksum at the time of scan, if it does not match the one in the barcode, the scanner assumes that some portion of the barcode was misprinted or misread and rejects the barcode.

To create barcode string with check digit, first calculate the checksum value. Derive the font character from the checksum value and append to the data. At last enclose the whole part with either asterisks or square brackets.

Table 4.1. Code39 value table

char value char value char value char value
0 0 A 10 N 23 hyphen (-) 36
1 1 B 11 O 24 period (.) 37
2 2 C 12 P 25 SPACE ( ) 38
3 3 D 13 Q 26 dollar ($) 39
4 4 E 14 R 27 slash (/) 40
5 5 F 15 S 28 plus (+) 41
6 6 G 16 T 29 percent (%) 42
7 7 H 17 U 30    
8 8 I 18 V 31    
9 9 J 19 W 32    
    K 20 X 33    
    L 21 Y 34    
    M 22 Z 35    

The following procedure explains how to calculate the modulo 43 checksum:

  1. First assign each character in the barcode a numeric value (0 through 42) according to Table 4.1, “Code39 value table”. The start and stop characters do not participate in the checksum calculation.

  2. Sum the values of all the data characters.

  3. Divide the result from step 2 by 43.

  4. The remainder from the division in step 3 is the checksum character that will be appended to the data message before the stop character.

Note that in Code39 font the SPACE character is represented by equal = sign or underscore _. This also applies on checksum values. If you get a checksum value of 38, you should add = to the barcode string instead.