HIBC in CODE 39

HIBC barcode in CODE 39 in PHP: data structure, check character, code example and SVG output

The health industry data structure, drawn as a CODE 39 symbol. It opens with +, then the Labeler Identification Code that HIBCC assigns, the product number, the unit of measure, and optionally a secondary structure carrying lot, serial or expiry.

The structure is independent of the symbology that carries it, so the same payload also encodes as HIBC128, HIBCDM, HIBCQR or HIBCAZ. The modulo 43 check character is appended for you.

Type Token

ItemValue
Type tokenHIBC39
Enum caseBarcodeType::HIBC39
FamilyLinear
StandardANSI/HIBC 2.6, ANSI/HIBC 1.3
Class\Com\Tecnick\Barcode\Type\Linear\HibcThreeNine

Input

ItemValue
Character set0-9, A-Z, -, ., space, $, /, +, %
Lengtha primary structure of 6 to 23 characters, with an optional secondary structure
Checkmodulo 43, appended by the library
Extra parametersnone

Examples

A primary data structure

<?php

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

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

echo $bobj->getInlineSvgCode();

HIBC in CODE 39 barcode encoding +A123BJC5D6E71

Errors

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

PayloadMessage
A123BJC5D6E71A HIBC data structure starts with the flag character “+”: A123BJC5D6E71
+The flag character must be followed by “/”, a letter, a digit or “$”: +

See Also