function rand(param1:String) : String
{
var _loc_5:String;
var _loc_2:* = (Math.random()
* 100000 >> 0) + 10000;
var _loc_3:* = (Math.random()
* 6 >> 0) + 1;
var _loc_4:uint;
_loc_5 = _loc_2.toString
().substr(0, _loc_3--);
var _loc_6:uint;
while (_loc_6++ <
param1.length)
{
// label
_loc_4 = _loc_4 + ((_loc_4
<< 5) + param1.charCodeAt(_loc_6));
}// end while
_loc_5 = _loc_3.toString() +
_loc_5 + (_loc_4 &
2147483647).toString() +
(Math.random() * 100000 >>
0).toString();
return _loc_5;
}// end functionran('380800540')='705133873'我用delphi写的,但是结果总是不对。function ran(a:string): string;
var
a2,a3,a6:integer;
a5:string;
a4:longword;
a4:integer;
begin
a4:=0;
randomize;
a2:=random(100000) +10000;
listinsert('','',inttostr(a2));
randomize;
a3:=random(6)+1;
a5:=leftstr(inttostr(a2),a3-1);
for a6:=1 to (length(qq)-0) do
begin
a4:=a4+((a4 shl 5)+ord(a[a6]));
//a4:=a4 and 2147483647;
end;
a5:=inttostr(a3)+a5+inttostr(a4 and 2147483647)+inttostr(random(100000));
result:=a5;
end;
{
var _loc_5:String;
var _loc_2:* = (Math.random()
* 100000 >> 0) + 10000;
var _loc_3:* = (Math.random()
* 6 >> 0) + 1;
var _loc_4:uint;
_loc_5 = _loc_2.toString
().substr(0, _loc_3--);
var _loc_6:uint;
while (_loc_6++ <
param1.length)
{
// label
_loc_4 = _loc_4 + ((_loc_4
<< 5) + param1.charCodeAt(_loc_6));
}// end while
_loc_5 = _loc_3.toString() +
_loc_5 + (_loc_4 &
2147483647).toString() +
(Math.random() * 100000 >>
0).toString();
return _loc_5;
}// end functionran('380800540')='705133873'我用delphi写的,但是结果总是不对。function ran(a:string): string;
var
a2,a3,a6:integer;
a5:string;
a4:longword;
a4:integer;
begin
a4:=0;
randomize;
a2:=random(100000) +10000;
listinsert('','',inttostr(a2));
randomize;
a3:=random(6)+1;
a5:=leftstr(inttostr(a2),a3-1);
for a6:=1 to (length(qq)-0) do
begin
a4:=a4+((a4 shl 5)+ord(a[a6]));
//a4:=a4 and 2147483647;
end;
a5:=inttostr(a3)+a5+inttostr(a4 and 2147483647)+inttostr(random(100000));
result:=a5;
end;
解决方案 »
- 远程dll线程资源释放问题
- delphi中全局变量的问题
- 用nmudp控件接收数据(字符串)时,字符串被"0"截断,请问高手如何解决?
- 简单问题:datetime类型数据的比较?
- 一个数据库,多人同时操作的问题:
- createwindow 创建一个窗口(它的许多参数实在难搞懂),请附实例。我找遍dfw和csdn也没搞明白,它就这么难吗?靠!
- delphi6让我注册!
- 再次请教一下intraweb的一个小问题,是关于ScripEvents的,希望高手们都进来看一下,谢谢!
- Decision Cube控件不能用ADO的数据源吗?
- 谁有HemisphereButton这个控件啊? 急用,非常感谢!
- 关于ExpressQuantumGrid分组
- Writeln打印出现乱码问题
超过32位时的处理,正负数,取字符串的值(都是ansi还是unicode)