home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / hacking / phreak_utils_pc / keyunit.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-04-01  |  743 b   |  35 lines

  1. unit keyunit;
  2.  
  3. interface
  4. function keyfor(s:string):longint;
  5.  
  6. implementation
  7.  
  8. function keyfor(s:string):longint;
  9. var x,y,z :longint;
  10.     bla   :string;
  11. begin
  12.   if length(s)<4 then begin
  13.     randomize;
  14.     y:=random(65535)*random(255);
  15.     keyfor:=y;
  16.     exit;
  17.   end;
  18.   y:=0;
  19.   for x:=1 to length(s) do y:=y+(ord(s[x])*length(s));
  20.   for x:=1 to length(s) do y:=y+(ord(s[x])-(length(s)+x));
  21.   for x:=1 to length(s) do y:=y+((ord(s[x])-20)*(length(s) div 2));
  22.   y:=y*y;
  23.   y:=y+(length(s)*length(s));
  24.   keyfor:=y;
  25. end;
  26.  
  27. begin
  28.   if paramstr(1)='/(C)' then begin
  29.     writeln('KEYUNIT.PAS  v1.00  Key Generation Routines');
  30.     writeln('                    (C) 1993 by OD/SLAM');
  31.     writeln;
  32.     readln;
  33.   end;
  34. end.
  35.