Skip to content

Commit

Permalink
fix(code93): Update encoder func to better handle checksum
Browse files Browse the repository at this point in the history
- Fix #80
  • Loading branch information
lmazeaud committed Jul 2, 2024
1 parent 65580ac commit d6f8bd4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code93/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d6f8bd4

Please sign in to comment.