From d6f8bd41ded6daf746525fb81af4abebae9f7eeb Mon Sep 17 00:00:00 2001 From: lmazeaud Date: Tue, 2 Jul 2024 17:32:56 +0200 Subject: [PATCH] fix(code93): Update encoder func to better handle checksum - Fix #80 --- code93/encoder.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code93/encoder.go b/code93/encoder.go index 42a7c30..87c4395 100644 --- a/code93/encoder.go +++ b/code93/encoder.go @@ -88,7 +88,9 @@ func Encode(content string, includeChecksum bool, fullASCIIMode bool) (barcode.B } data := content + string(getChecksum(content, 20)) - data += string(getChecksum(data, 15)) + if includeChecksum { + data += string(getChecksum(data, 15)) + } data = "*" + data + "*" result := new(utils.BitList)