/**
* Product Check code algorithm
* EAN-13 Barcode Algorithm
* The first 12 digits of the odd digits and C1
* The first 12 digits of the parity and C2
* will be odd and even and three times times the sum * to
take the result of the single digit, to 10 remainder (If the single-digit number is 0, then the checksum code is not 10, but 0)
* @author HANMJ
/public class Eancodeutil {public
static void Main (string[) args) {
/*string Eancode = Eancode ("123675223432");
System.out.println (Eancode); */
} public
static String Eancode (String code) {
int c1=0;
int c2=0;
for (int i=0;i<code.length (); i+=2) {
char c=code.charat (i);
Character
int n=c-' 0 ' at position I in string code;
c1+=n;//the number of odd digits and
} for
(int i=1;i<code.length (); i+=2) {
char c=code.charat (i); Character
int n=c-' 0 ' at position I in string code;
c2+=n;//the number of cumulative even digits and the
}
int cc=c1+c2*3;
int check=cc%10;
check= (10-cc%10)%10;
Code+=check+ "";
return code;
}