貼上Winzip的序號產生器(好像老了點),算是初到此處的見面禮吧 (497字)

看雪資料發表於2001-11-17

procedure TForm1.Button1Click(Sender: TObject);
Var i,k,l:integer;
a,b,c:dword;
Begin
k:=0;a:=0;b:=0;c:=0;
for i:=0 to length(names.text)-1 do begin
    k:=k+ord(names.text[i+1])*i;
    c:=ord(names.text[i+1]) shl 8;
    for l:=1 to 8 do begin
        b:=a;
        b:=b xor c;
        if ((b and 65535) and $8000)=0 then a:=a shl 1
        else a:=(a*2) xor 4129;
        c:=c shl 1;
    end;
end;
k:=k and 65535;
a:=(a+99) and 65535;
sn.text:=inttohex(a,4)+inttohex(k,4);
End;

相關文章