io c'avevo provato ma non funzionava ^^
leggi la mail che ti ho inviato ... nel mio codice sorgente ciè un metodo della classe apposito per fare la cosa
se non erro si chiama Lock2Key
codice:
// Lock To Key function written by [RO]VeNoM
/*-------------------
NOT COMMENTED
-------------------*/
/**
* PHPDCFrameWork::__lock2key()
*
* This function decode LOCK sendend from HUB SERVER and CLIENT.
* Return decoded LOCK, called KEY
*
* @param $_LOCK // LOCK String
* @return
*/
function __lock2key($_LOCK) {
// Get LOCK String Length
$LockLength = strlen($_LOCK);
// Start to Decode FIRST CHAR
$h = ord($_LOCK{0}) ^ ord( $_LOCK{ $LockLength - 1} ) ^ ord( $_LOCK{ $LockLength - 2} ) ^ 5;
while ($h > 255) {$h = $h - 256;}
$h = (($h<<4) & 240) | (($h>>4) & 15);
$a = $h;
if ($a == '126' OR $a == '124' OR $a == '96' OR $a == '36' OR $a == '5' OR $a == '0') {
$LockToKey = "/%DCN";
if ($a < 100) {$LockToKey .= "0";}
if ($a < 10) {$LockToKey .= "0";}
$LockToKey .= $a;
$LockToKey .= "%/";
} else {
$LockToKey = chr($a);
}
// Decode Other Chars
for ($j = 1; $j < strlen($_LOCK); $j++) {
$h = ord($_LOCK{$j}) ^ ord($_LOCK{$j-1});
while ($h > 255) {$h = $h - 256;}
$h = (($h<<4) & 240) | (($h>>4) & 15);
$a = $h;
if ($a == '126' OR $a == '124' OR $a == '96' OR $a == '36' OR $a == '5' OR $a == '0') {
$LockToKey .= "/%DCN";
if ($a < 100) {$LockToKey .= "0";}
if ($a < 10) {$LockToKey .= "0";}
$LockToKey .= $a;
$LockToKey .= "%/";
} else {
$LockToKey .= chr($a);
}
}
// Return Dedoced LOCK String
return $LockToKey;
}