Interleaved 2 of 5 with check digit

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

Interleaved 2 of 5 with a modulo 10 check digit. The check is computed first and the result padded to an even length afterwards, so a ten-digit payload is drawn as twelve digits.

Type Token

ItemValue
Type tokenI25+
Enum caseBarcodeType::I25Plus
FamilyLinear
StandardISO/IEC 16390
Class\Com\Tecnick\Barcode\Type\Linear\InterleavedTwoOfFiveCheck

Input

ItemValue
Character setdigits
Lengthany number of digits; the result is padded to an even length
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: 'I25+',
    code: '0123456789',
    width: -3,
    height: -30,
    color: 'black',
    padding: [0, 0, 0, 0],
)->setBackgroundColor('white');

echo $bobj->getInlineSvgCode();

Interleaved 2 of 5 with check digit barcode encoding 0123456789

Errors

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

PayloadMessage
12AInvalid character sequence: a5

See Also