| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2215 人关注过本帖
标题:求高手帮忙,帮我反写个程序,谢谢
取消只看楼主 加入收藏
as4491
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2015-2-9
收藏
 问题点数:0 回复次数:0 
求高手帮忙,帮我反写个程序,谢谢
<?
function sample($s)
{
$hexchars = '0123456789ABCDEF';
if ( !$s || strlen($s) <= 0 )
{
echo "null string.";
return "";
}
$len = strlen($s);
$ret = '';
$curc = 0;
    $nextc = ord(substr($s, 0, 1));
for ($i=1; $i<$len; $i++ )
{
$curc = $nextc;
$nextc = ord(substr($s, $i, 1));
$curc ^= $nextc;
//echo '<br> 0x'. substr($hexchars, ($curc & 0xF0) >> 4, 1) . substr($hexchars, $curc & 0x0F, 1);
$ret .= substr($hexchars, ($curc & 0xF0) >> 4, 1);
$ret .= substr($hexchars, $curc & 0x0F, 1);
}
$curc = $nextc ^ 0x7C;
$ret .= substr($hexchars, ($curc & 0xF0) >> 4, 1);
echo $ret;
echo "<br>";
$ret .= substr($hexchars, $curc & 0x0F, 1);
return $ret;
}
$a="srvaddr=127.0.0.1";
$b=sample($a);
echo $b;
function sample2($s)
{
    //现在就想写个程序,把这个$b给还原成$a,请高手帮忙写个
}
$c=sample2($b);
echo $c;


?>
搜索更多相关主题的帖子: function return null 
2015-02-09 19:03
快速回复:求高手帮忙,帮我反写个程序,谢谢
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014246 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved