Skip to content

Commit 02693c9

Browse files
committed
* Removed leading zero for barcodes of type "Standard 2 of 5", in case the code (including checksum, if present) was odd.
* Fixed wrong encoding for character '8' (was encoded as '0').
1 parent 9944c65 commit 02693c9

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Types/TypeStandard2of5.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,12 @@ public function getBarcodeData(string $code): Barcode
2626
$chr['5'] = '11101011101010';
2727
$chr['6'] = '10111011101010';
2828
$chr['7'] = '10101011101110';
29-
$chr['8'] = '10101110111010';
29+
$chr['8'] = '11101010111010';
3030
$chr['9'] = '10111010111010';
3131
if ($this->checksum) {
3232
// add checksum
3333
$code .= $this->checksum_s25($code);
3434
}
35-
if ((strlen($code) % 2) != 0) {
36-
// add leading zero if code-length is odd
37-
$code = '0' . $code;
38-
}
3935
$seq = '11011010';
4036

4137
for ($i = 0; $i < strlen($code); ++$i) {

0 commit comments

Comments
 (0)