We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0cc7fbd commit acaf80fCopy full SHA for acaf80f
src/Types/TypeITF14.php
@@ -73,8 +73,8 @@ private function getChecksum(string $code): string
73
$total = 0;
74
75
for ($charIndex = 0; $charIndex <= (strlen($code) - 1); $charIndex++) {
76
- $integerOfChar = intval($code . substr($charIndex, 1));
77
- $total += $integerOfChar * (($charIndex === 0 || $charIndex % 2 === 0) ? 3 : 1);
+ $integerOfChar = intval($code[$charIndex]);
+ $total += $integerOfChar * ($charIndex % 2 === 0 ? 3 : 1);
78
}
79
80
$checksum = 10 - ($total % 10);
0 commit comments