mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-12 23:08:41 +00:00
Fix increment order
This commit is contained in:
parent
13c5562ffe
commit
2f32c9e22b
|
|
@ -301,7 +301,7 @@ abstract class C128Abstract
|
||||||
$length = \strlen($this->content);
|
$length = \strlen($this->content);
|
||||||
$checksum = static::$CHECKSUM;
|
$checksum = static::$CHECKSUM;
|
||||||
|
|
||||||
for ($pos = 1; $pos <= $length; $pos++) {
|
for ($pos = 1; $pos <= $length; ++$pos) {
|
||||||
$activeKey = \substr($this->content, ($pos - 1), 1);
|
$activeKey = \substr($this->content, ($pos - 1), 1);
|
||||||
$codeString .= static::$CODEARRAY[$activeKey];
|
$codeString .= static::$CODEARRAY[$activeKey];
|
||||||
$checksum += $values[$activeKey] * $pos;
|
$checksum += $values[$activeKey] * $pos;
|
||||||
|
|
@ -336,7 +336,7 @@ abstract class C128Abstract
|
||||||
$length = \strlen($codeString);
|
$length = \strlen($codeString);
|
||||||
\imagefill($image, 0, 0, $white);
|
\imagefill($image, 0, 0, $white);
|
||||||
|
|
||||||
for ($position = 1; $position <= $length; $position++) {
|
for ($position = 1; $position <= $length; ++$position) {
|
||||||
$cur_size = $location + (int) (\substr($codeString, ($position - 1), 1));
|
$cur_size = $location + (int) (\substr($codeString, ($position - 1), 1));
|
||||||
|
|
||||||
if ($this->orientation === OrientationType::HORIZONTAL) {
|
if ($this->orientation === OrientationType::HORIZONTAL) {
|
||||||
|
|
|
||||||
|
|
@ -113,8 +113,8 @@ class C25 extends C128Abstract
|
||||||
$arrayLength = \count(self::$CODEARRAY);
|
$arrayLength = \count(self::$CODEARRAY);
|
||||||
$temp = [];
|
$temp = [];
|
||||||
|
|
||||||
for ($posX = 1; $posX <= $length; $posX++) {
|
for ($posX = 1; $posX <= $length; ++$posX) {
|
||||||
for ($posY = 0; $posY < $arrayLength; $posY++) {
|
for ($posY = 0; $posY < $arrayLength; ++$posY) {
|
||||||
if (\substr($this->content, ($posX - 1), 1) == self::$CODEARRAY[$posY]) {
|
if (\substr($this->content, ($posX - 1), 1) == self::$CODEARRAY[$posY]) {
|
||||||
$temp[$posX] = self::$CODEARRAY2[$posY];
|
$temp[$posX] = self::$CODEARRAY2[$posY];
|
||||||
}
|
}
|
||||||
|
|
@ -127,7 +127,7 @@ class C25 extends C128Abstract
|
||||||
$temp2 = \explode('-', $temp[($posX + 1)]);
|
$temp2 = \explode('-', $temp[($posX + 1)]);
|
||||||
|
|
||||||
$count = \count($temp1);
|
$count = \count($temp1);
|
||||||
for ($posY = 0; $posY < $count; $posY++) {
|
for ($posY = 0; $posY < $count; ++$posY) {
|
||||||
$codeString .= $temp1[$posY] . $temp2[$posY];
|
$codeString .= $temp1[$posY] . $temp2[$posY];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ class C39 extends C128Abstract
|
||||||
$codeString = '';
|
$codeString = '';
|
||||||
$length = \strlen($this->content);
|
$length = \strlen($this->content);
|
||||||
|
|
||||||
for ($X = 1; $X <= $length; $X++) {
|
for ($X = 1; $X <= $length; ++$X) {
|
||||||
$codeString .= self::$CODEARRAY[substr($this->content, ($X - 1), 1)] . '1';
|
$codeString .= self::$CODEARRAY[substr($this->content, ($X - 1), 1)] . '1';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -89,8 +89,8 @@ class Codebar extends C128Abstract
|
||||||
$length = \strlen($this->content);
|
$length = \strlen($this->content);
|
||||||
$lenCodearr = \count(self::$CODEARRAY);
|
$lenCodearr = \count(self::$CODEARRAY);
|
||||||
|
|
||||||
for ($posX = 1; $posX <= $length; $posX++) {
|
for ($posX = 1; $posX <= $length; ++$posX) {
|
||||||
for ($posY = 0; $posY < $lenCodearr; $posY++) {
|
for ($posY = 0; $posY < $lenCodearr; ++$posY) {
|
||||||
if (\substr($this->content, ($posX - 1), 1) == self::$CODEARRAY[$posY]) {
|
if (\substr($this->content, ($posX - 1), 1) == self::$CODEARRAY[$posY]) {
|
||||||
$codeString .= self::$CODEARRAY2[$posY] . '1';
|
$codeString .= self::$CODEARRAY2[$posY] . '1';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ final class XorEncoding
|
||||||
$length = \strlen($source);
|
$length = \strlen($source);
|
||||||
$keyLength = \strlen($key) - 1;
|
$keyLength = \strlen($key) - 1;
|
||||||
|
|
||||||
for ($i = 0, $j = 0; $i < $length; ++$i, $j++) {
|
for ($i = 0, $j = 0; $i < $length; ++$i, ++$j) {
|
||||||
if ($j > $keyLength) {
|
if ($j > $keyLength) {
|
||||||
$j = 0;
|
$j = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user