Search code examples
phpbarcodecode128

How to calculate check digit for Barcode 128 Auto php


I have a string which uses 128B and 128C conversion. ANCV0005YRF01234. So

ANCV = 128B
0005 = 128C
YRF0= 128B
1234= 128 C

Cant use code 128 Auto as it converts the 0 after F into 128C (which i dont want.). At the moment using two different scripts and concatenating the barcode images,Need to calculate the check digit for that. Not sure how the check digit will be generated ?. Any help is appreciated. Thanks


Solution

  • I got sum of characters by weights (rightmost column) from your example string = 5468 % 103 = 9 for a checksum if you want to switch back and forth.

    Start Code B = 104, Switch to C = 99, Switch to B = 100