Skip to content

Commit

Permalink
Merge pull request #161 from Bernhard-Krop/standard-2-of-5
Browse files Browse the repository at this point in the history
Fixing barcode type "Standard 2 of 5"
  • Loading branch information
casperbakker authored Jul 1, 2022
2 parents 7b053ad + 326113c commit 52f3453
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 54 deletions.
6 changes: 1 addition & 5 deletions src/Types/TypeStandard2of5.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,12 @@ public function getBarcodeData(string $code): Barcode
$chr['5'] = '11101011101010';
$chr['6'] = '10111011101010';
$chr['7'] = '10101011101110';
$chr['8'] = '10101110111010';
$chr['8'] = '11101010111010';
$chr['9'] = '10111010111010';
if ($this->checksum) {
// add checksum
$code .= $this->checksum_s25($code);
}
if ((strlen($code) % 2) != 0) {
// add leading zero if code-length is odd
$code = '0' . $code;
}
$seq = '11011010';

for ($i = 0; $i < strlen($code); ++$i) {
Expand Down
87 changes: 41 additions & 46 deletions tests/verified-files/S25+-1234567890.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions tests/verified-files/S25-1234567890.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 52f3453

Please sign in to comment.