I was trying out different EPCs and ran into an error. If the checkdigit=0, then code was throwing an error on out of bounds. After troubleshooting it I noticed it was happening on the calculation of the check digit and found it was caused by the value of item reference not having enough digits. The leading 0's from item reference were getting dropped. I noticed you had a function to fill those, so I tried it and it fixed issue.
After this line
String itemReferenceWithExtensionDec = Converter.binToDec(itemReferenceWithExtensionBin);
I added this
itemReferenceWithExtensionDec = Converter.strZero(itemReferenceWithExtensionDec, tableItem.getDigits());
I was trying out different EPCs and ran into an error. If the checkdigit=0, then code was throwing an error on out of bounds. After troubleshooting it I noticed it was happening on the calculation of the check digit and found it was caused by the value of item reference not having enough digits. The leading 0's from item reference were getting dropped. I noticed you had a function to fill those, so I tried it and it fixed issue. After this line String itemReferenceWithExtensionDec = Converter.binToDec(itemReferenceWithExtensionBin); I added this
itemReferenceWithExtensionDec = Converter.strZero(itemReferenceWithExtensionDec, tableItem.getDigits());
Nervin