Encode/Decode
Einfacher Encoder/Decoder Algorithmus :
|
Script: |
<?
function encode($code,$key)
{
$laenge = strlen($code);
while($n < $laenge)
{
$encode .= chr(ord( substr($code,$n,1))+$key);
$n++;
}
return $encode;
}
//////////////////////////////////////////////
function decode($decode,$key)
{
$laenge = strlen($decode);
while($n < $laenge)
{
$decodetext .=chr(ord( substr($decode,$n,1))-$key);
$n++;
}
return $decodetext;
}
?>
|
|