hedgewars/uRandom.pas
changeset 5 0dafbd19a04c
parent 4 bcbd7adb4e4b
child 21 dff476dcaaa3
equal deleted inserted replaced
4:bcbd7adb4e4b 5:0dafbd19a04c
    66 var dig: TSHA1Digest;
    66 var dig: TSHA1Digest;
    67 begin
    67 begin
    68 SHA1Update(sc1, @Fill[1], Length(Fill));
    68 SHA1Update(sc1, @Fill[1], Length(Fill));
    69 sc2:= sc1;
    69 sc2:= sc1;
    70 dig:= SHA1Final(sc1);
    70 dig:= SHA1Final(sc1);
    71 Result:= (((dig.LongWords[0] mod m) + (dig.LongWords[2] mod m)) mod m + (dig.LongWords[3] mod m)) mod m;
    71 Result:= (dig.LongWords[0] + dig.LongWords[2] + dig.LongWords[3]) mod m;
    72 sc1:= sc2
    72 sc1:= sc2
    73 end;
    73 end;
    74 
    74 
    75 end.
    75 end.