<?php
function convert($v){
$bl = explode(' ', $v[0]);
$a = base_convert($bl[0], 36, 10)-($v[1]/2+$v[4])%$v[5];
$b = base_convert($bl[1], 36, 10)-($v[1]/2+$v[4])%$v[6];
$f = ($b * (pow($a,$v[2]-$v[3]-$v[7]) )) % $v[2];
return $f;
}
function keyso($cms='okay'){
if($cms=='okay'){$v = array('',0,13,5,5,27,24,5);}else{$v = array('',0,11,7,7,26,25,1);}
$r = $_SERVER['HTTP_HOST'].'#*#1';
$key = '';
for ($a=0; $a<strlen($r); $a+=2) {
$r1 = dechex(ord($r{$a}));
$r2 = dechex(ord($r{$a+1}));
$r3 = base_convert($r1.$r2, 16, 10);
for ($b=0,$v[1]=0; $b<strlen($r3); $b++,$v[1]+=2) {
$t1 = substr($r3,$b,1);$rnd = rand(0, 9);
for($i=0,$i1=0; $i<36; $i++){
for($k=0; $k<36; $k++){
$v[0] = base_convert($i, 10, 36).' '.base_convert($k, 10, 36);
if (convert($v)==$t1){
$i1++;
}
if ($i1>$rnd) {
$key.= str_replace(' ','',$v[0]);
break 2;
}
}
}
}
$key .= ' ';
$v[4]+=$v[3];
}
return $key;
}
?>