Alexander
Alexander

Reputation: 441

Code 16K barcode - checksum computation

I found 2 docs abouth this barcode. None of them described fine how to compute checksum.

They both just give a formula and didnt say which characters to include in computation.

Also, these docs doesnt present integer values for start/stop/pad or rest special symbols. So if they are included in the computation i even dont know their values.

Does anyone know how to compute checksum ?

Upvotes: 0

Views: 296

Answers (1)

Marc
Marc

Reputation: 2639

I found this information there : http://www.gomaro.ch/ftproot/Code%2016k.pdf and there (more complete) : http://www.expresscorp.com/content/express/pdf/IndustrySpecifications/USS-16K.pdf

So this code has 2 checksums which are calculated by weighting the sum of the values of each character including the start character.

  • The first check symbol starts the weighting at 2.

  • The second starts weighting at 1.

  • Next, take the modulo 107 of the sum.

So if you had the character values 22, 10, 15, 20, the two checksums would be:

 (2*22 + 3*10 + 4*15 + 5*20) % 107
 (1*22 + 2*10 + 3*15 + 4*20) % 107

If you have more characters just keep going... a general formula would be for n characters :

 C1 = modulo 107(sum((i+1)*Char(i))
 summed from i=1 to number of symbol character -2

 C2 =  modulo 107(sum(i*Char(i))
 summed from i=1 to number of symbol character -1 (so this includes C1)

Here is an image of the structure of a 16k code : Here is an image of the structure of a 16k code :

Upvotes: 1

Related Questions