MSI with check digit

MSI with the modulo 11 check digit in PHP: input range, code example and SVG output

MSI with a modulo 11 check digit appended. A payload whose check works out to 10 has no single character to write it in, and is rejected.

Type Token

ItemValue
Type tokenMSI+
Enum caseBarcodeType::MSIPlus
FamilyLinear
Class\Com\Tecnick\Barcode\Type\Linear\MsiCheck

Input

ItemValue
Character set0-9 and A-F
Length1 to 30000 characters
Checkmodulo 11, 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: 'MSI+',
    code: '0123456789',
    width: -3,
    height: -30,
    color: 'black',
    padding: [0, 0, 0, 0],
)->setBackgroundColor('white');

echo $bobj->getInlineSvgCode();

MSI with check digit barcode encoding 0123456789

Errors

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

PayloadMessage
GHIInvalid character: 71

See Also