1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
|
[...]
/**
* @desc Perform the appropriate triplet combination function for the current
* iteration
*/
function sha1_ft($t, $b, $c, $d) {
if ($t < 20) return ($b & $c) | ((~$b) & $d);
elseif ($t < 40) return $b ^ $c ^ $d;
elseif ($t < 60) return ($b & $c) | ($b & $d) | ($c & $d);
else return $b ^ $c ^ $d;
}
/**
* @desc Determine the appropriate additive constant for the current iteration
*/
function sha1_kt($t) {
if ($t < 20) return 1518500249;
elseif ($t < 40) return 1859775393;
elseif ($t < 60) return - 1894007588;
else return - 899497514;
}
}
function attachftp_connect($ftpuser,$ftppassword) {
global $ftphost;
$ftp = @ftp_connect($ftphost);
if ($ftp) {
if (@ftp_login($ftp,$ftpuser,urldecode($ftppassword))) {
return $ftp;
}
}
}
function getgentime($start,$end) {
$start=explode(" ",$start);
$end=explode(" ",$end);
$result=$end[0]-$start[0]+$end[1]-$start[1];
return substr($result,0,5);
}
?> |