Advertisement
ridjis

Hash Kancelarije

Oct 29th, 2014
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. PROCEDURE Hash(elem: InfoTip) : CARDINAL;
  2. VAR i, rez, duzina: CARDINAL;
  3. BEGIN
  4.   rez:=0;
  5.   duzina := Length(elem.prezime);
  6.   FOR i:=1 TO duzina DO
  7.     rez := rez + ((ORD(elem.prezime[i])*ORD(elem.prezime[i])*ORD(elem.prezime[i])));
  8.     IF rez < 600 THEN
  9.       rez := rez MOD 439;
  10.     ELSIF rez > 600 THEN
  11.       rez := rez MOD 521;
  12.     END;
  13.   END;
  14.   rez := rez + elem.soba;
  15.   RETURN rez MOD VelicinaTabele;
  16. END Hash;
  17.  
  18. // http://www.dodaj.rs/f/3O/JO/3qkEi3Wf/kanc-ord3-if.jpg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement