EAN-2 explained

The EAN-2 is a supplement to the EAN-13 and UPC-A barcodes. It is often used on magazines and periodicals to indicate an issue number.

Encoding

The encoding of EAN-2 characters is very similar to that of the other European Article Numbers. The only difference is that the digits are separated by 01. The EAN-2 always begins with "01011". Also, the R-Code is not used.

The structure of the barcode is based on the value of the two digit to be encoded. The two digits treated as a single two-digit number is reduced modulo 4 and used to find the parity pattern to be used. The parity pattern repeats every 4 values.

EAN-2 Parity
Data to encode Parity pattern
Encode as 0 from L table followed by 0 from L table
Encode as 0 from L table followed by 1 from G table
Encode as 0 from G table followed by 2 from L table
Encode as 0 from G table followed by 3 from G table
Encode as 0 from L table followed by 4 from L table
Encode as 0 from L table followed by 5 from G table
Encode as 0 from G table followed by 6 from L table
Encode as 0 from G table followed by 7 from G table
Encode as 9 from G table followed by 8 from L table
Encode as 9 from G table followed by 9 from G table

References