Last active
May 20, 2022 07:01
-
-
Save kaystrobach/7aa08be92373be66efb6a1d36705d1b1 to your computer and use it in GitHub Desktop.
Revisions
-
kaystrobach revised this gist
May 19, 2022 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,4 +3,9 @@ // needs picqer/php-barcode-generator $generator = new \Picqer\Barcode\BarcodeGeneratorPNG(); $barcode = $generator->getBarcode($data, $generator::TYPE_CODE_128, 3, 100, [0,0,0]); // ensure the char count is even for CODE_128_C $barcodeData = (strlen($data) % 2) === 0 ? $data : '0' . $data; $generator = new \Picqer\Barcode\BarcodeGeneratorPNG(); $barcode = $generator->getBarcode($barcodeData, $generator::TYPE_CODE_128_C, 3, 100, [0,0,0]); -
kaystrobach created this gist
May 19, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ <?php // needs picqer/php-barcode-generator $generator = new \Picqer\Barcode\BarcodeGeneratorPNG(); $barcode = $generator->getBarcode($data, $generator::TYPE_CODE_128, 3, 100, [0,0,0]); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ <?php // needs ramsey/uuid class UuidConverterService { public static function fromUuidToNumberString(string $uuid): string { $uuidObject = Uuid::fromString($uuid); return $uuidObject->getInteger()->toString(); } public static function fromNumberStringToUuid(string $integer): string { $uuidObject = Uuid::fromInteger($integer); return $uuidObject->toString(); } }