<?php
$map = [
6 => 215601,
11 => 3260461,
7 => 210282,
11 => 3258941
];
foreach($map as $key => $value) {
$p = str_pad($key, 3, '0', STR_PAD_LEFT) . str_pad($value, 10, '0', STR_PAD_LEFT);
echo "\n";
echo $p;
$ctr = 22;
$ctro = '0' . substr($p,1,2) . substr($p,6);
echo "\n";
echo $ctro;
for ($i=0; $i <= 8; $i+=2) {
$ctr = $ctr + 3*(int)substr($ctro,$i,1) + (int)substr($ctro,(1+$i),1);
}
echo "\n";
echo $ctr;
$ctr = (10 - ($ctr % 10)) % 10;
echo "\n";
echo "Key = " . $ctr;
}
preferences:
28.99 ms | 402 KiB | 5 Q