boombuler / barcode

a barcode creation lib for golang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EAN128 Barcode could be shorter (in case of GS1-128)

sugacube opened this issue · comments

In case a GS1-128 bar code is generated (this is an EAN128), the bar code is encoded using Code B symbols. In this case however Code C can be used : the sequence is always FNC1 + even number of digits. Although the Code B encoding is technically correct, normally for GS1-128 Code C is used as this results in shorter bar codes.

I looked at the code, it appears function "shouldUseCTable" only checks digits, not FNC1. Ignoring FNC1 in this function appears to solve the issue, and generates shorter Code C bar codes.