Standard 2 of 5 with check digit

Standard 2 of 5 with the modulo 10 check digit in PHP: input range, code example and SVG output

Standard 2 of 5 with a modulo 10 check digit computed over the payload and appended before encoding.

Type Token

ItemValue
Type tokenS25+
Enum caseBarcodeType::S25Plus
FamilyLinear
Class\Com\Tecnick\Barcode\Type\Linear\StandardTwoOfFiveCheck

Input

ItemValue
Character setdigits
Length1 to 30000 characters
Checkmodulo 10, appended by the library
Extra parametersnone

Examples

Ten digits and the appended check

<?php

require_once __DIR__ . '/vendor/autoload.php';

$barcode = new \Com\Tecnick\Barcode\Barcode();
$bobj = $barcode->getBarcodeObj(
    type: 'S25+',
    code: '0123456789',
    width: -3,
    height: -30,
    color: 'black',
    padding: [0, 0, 0, 0],
)->setBackgroundColor('white');

echo $bobj->getInlineSvgCode();

Standard 2 of 5 with check digit barcode encoding 0123456789

Errors

These payloads raise \Com\Tecnick\Barcode\Exception:

PayloadMessage
12AInvalid character: 65

See Also