本帖最后由 twnet 于 2013-6-16 18:43 编辑
PHP代码<?php
echo getMixString($seed);
function getMixString($seed) {
$seed = 6616;
$mixed = "";
$source = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/\\:._-1234567890";
$len = strlen($source);
for($i=0;$i< $len;++$i){
$seed = ($seed * 211 + 30031) % 65536;
$index = ($seed / 65536 * strlen($source));
$c = substr($source,$index,1);
$mixed .= $c;
$source = str_replace($c, "",$source);
}
return $mixed;
}
?>
对PHP不太懂,翻看了W3School教程里关于PHP各函数说明,还特意搭建了PHP环境来测试
返回值如图:
转成AU3后的代码$sed = 6616
MsgBox('', '', getMixString($sed))
Func getMixString($seed)
Local $mixed = ''
Local $source = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/\\:._-1234567890'
;Local $index
Local $len = StringLen($source)
For $i = 1 To $len-1
$seed = Mod(($seed * 211 + 30031),65536)
$index = ($seed / 65536 * StringLen($source))
$c = StringMid($source, $index, 1)
$mixed &= $c
$source = StringReplace($source, $c, '', 0, 1)
Next
Return $mixed
EndFunc
返回值如图
AU3也新手啊,看这结果真蛋疼,真不知道问题出在哪了 有帮忙看看的吗? |