/var/www/doncode.com.ua/www/libs
Edit: /var/www/doncode.com.ua/www/libs/class.BarcodeI25.php (2171B)
-1; $i--){
$v = intval($code[$i]);
$sum += $odd ? 3 * $v : $v;
$odd = ! $odd;
}
$code .= (string) ((10 - $sum % 10) % 10);
}
return($code);
}
static public function getDigit($code, $crc, $type){
$code = self::compute($code, $crc, $type);
if ($code == '') return($code);
$result = '';
if ($type == 'int25') { // Interleaved 2 of 5
// start
$result .= '1010';
// digits + CRC
$end = strlen($code) / 2;
for($i=0; $i<$end; $i++){
$c1 = $code[2*$i];
$c2 = $code[2*$i+1];
for($j=0; $j<5; $j++){
$result .= '1';
if (self::$encoding[$c1][$j] == 'W') $result .= '1';
$result .= '0';
if (self::$encoding[$c2][$j] == 'W') $result .= '0';
}
}
// stop
$result .= '1101';
} else if ($type == 'std25') {
// Standard 2 of 5 is a numeric-only barcode that has been in use a long time.
// Unlike Interleaved 2 of 5, all of the information is encoded in the bars; the spaces are fixed width and are used only to separate the bars.
// The code is self-checking and does not include a checksum.
// start
$result .= '11011010';
// digits + CRC
$end = strlen($code);
for($i=0; $i<$end; $i++){
$c = $code[$i];
for($j=0; $j<5; $j++){
$result .= '1';
if (self::$encoding[$c][$j] == 'W') $result .= '11';
$result .= '0';
}
}
// stop
$result .= '11010110';
}
return($result);
}
}
?>