The Interleaved 2 of 5 check digit is calculated wrong.
The error is an inverted logic condition
The check sum digit rule is that the right most digit
is considered an even digit. The check sum as
implemented has the right most digit as odd. (see
http://www.barcodeisland.com/2of5.phtml for check sum
calculation for I2of5)
In order to fix this change the logic at
GetCheckCharacters method from:
for I := 1 to bcDigitCount do
if Odd(I) then
TO:
for I := 1 to bcDigitCount do
if not(Odd(I)) then
This then calculates the proper check sum.
I have verified the check sum via calculations and via
my barcode reader that validates checksums, and this
code change makes it work.
Check sum examples
312
The 2 should be considered even along with the 3.
However in the original implementation the 3 and the 2
are considered odd. In the GetCheckCharacters the St
variable in this case is 312.
4312
The 2 and the 3 again should be considered even.
However, since I2of5 requires an even number of total
digits, include the check digit, the St variable is set
to 04312, which again makes the 3 and the 2 odd digits
instead of even, as they should be.