...Человеческий поиск в разработке...
- Модуль: ui
- Путь к файлу: ~/bitrix/modules/ui/lib/barcode/barcodegenerator.php
- Класс: BitrixUIBarcodeBarcodeGenerator
- Вызов: BarcodeGenerator::code_128_encode
private function code_128_encode($data, $dstate, $fnc1) { $data = preg_replace('/[x80-xFF]/', '', $data); $label = preg_replace('/[x00-x1Fx7F]/', ' ', $data); $chars = $this->code_128_normalize($data, $dstate, $fnc1); $checksum = $chars[0] % 103; for ($i = 1, $n = count($chars); $i < $n; $i++) { $checksum += $i * $chars[$i]; $checksum %= 103; } $chars[] = $checksum; $chars[] = 106; $modules = array(); $modules[] = array(0, 10, 0); foreach ($chars as $char) { $block = $this->code_128_alphabet[$char]; foreach ($block as $i => $module) { $modules[] = array(($i & 1) ^ 1, $module, 1); } } $modules[] = array(0, 10, 0); $blocks = array(array('m' => $modules, 'l' => array($label))); return array('g' => 'l', 'b' => $blocks); }