private String getBarcodeCheckBit(String barcodeNumber) {
StringBuffer result = new StringBuffer();
if (barcodeNumber.length() <= NORMAL_BARCODE_LENGTH) {
for (int i = 0; i < NORMAL_BARCODE_LENGTH - barcodeNumber.length(); i++) {
result.append("0");
}
result.append(barcodeNumber);
}
String barcode = result.toString();
int s = 0;
int d = 0;
for (int i = 0; i < NORMAL_BARCODE_LENGTH - 1; i++) {
if (i % 2 == 0) {
s += Character.getNumericValue(barcode.charAt(i));
} else {
d += Character.getNumericValue(barcode.charAt(i)) * 3;
}
}
int chk = (10 - ((s + d) % 10)) % 10;
return String.valueOf(chk);
}