Closed shinbin closed 9 months ago
I refer to https://en.wikipedia.org/wiki/EAN-2 , and modified convert(String data) function,
Changed =>
yield* add(codes[((pattern >> index) & 1) ^ 1], 7);
Replaced to =>
if(index == 0){ yield add(codes[pattern < 2 ? 0 : 1], 7); } else { yield add(codes[pattern % 2 == 0 ? 0 : 1], 7); }
In this way, the EAN2 barcode can be generated correctly. Please the author also modify the barcode 2.2.4 package, and update it to https://pub.dev/packages/barcode . Let's reference this library directly. Thanks.
@shinbin Please create a Pull Request.
@DavBfr Thanks for the guidance, I've created a Pull Request.
Fixed.
Hello author, I would like to report that the barcode content generated by ean2 is wrong in v2.2.4 . The data content is such as "12" or "48", etc., resulting in an incorrect ean2 barcode. I have used Scanner to scan EAN8 with EAN2 addon and other barcode tests. I also refer to the EAN2 content generated by professional barcode software or websites ( 'https://www.online-barcode.com/'). The EAN2 barcodes produced by these sources are different from v2.2.4. Please help with the revision, thank you very much.