for($Number;$Number>=16;){
$N = $Number / 16;
$rez = $rez . $N;
}
$Number = $rez;
return $Number;
}
function dec($h) {
$s = array('a'=>10, 'b'=>11, 'c'=>12, 'd'=>13, 'e'=>14, 'f'=>15);
if ($h) {
$a = substr($h, -1);
$h = dec(substr($h, 1));
if (!($a<10))
$a = $s[$a];
return 10*$h + $a;
}
}
function hex($d) {
$s = array(10=>'a', 11=>'b', 12=>'c', 13=>'e', 14=>'d', 15=>'f');
if ($d) {
$a = $d % 16;
$d = hex(($d-$a)/16);
if ($a>=10)
$a = $s[$a];
return $d.$a;
}
}