equal
deleted
inserted
replaced
64 function GetRandom(m: LongWord): LongWord; |
64 function GetRandom(m: LongWord): LongWord; |
65 var dig: TSHA1Digest; |
65 var dig: TSHA1Digest; |
66 begin |
66 begin |
67 SHA1Update(sc1, @Fill[1], Length(Fill)); |
67 SHA1Update(sc1, @Fill[1], Length(Fill)); |
68 sc2:= sc1; |
68 sc2:= sc1; |
69 dig:= SHA1Final(sc1); |
69 dig:= SHA1Final(sc2); |
70 Result:= (dig.LongWords[0] + dig.LongWords[2] + dig.LongWords[3]) mod m; |
70 Result:= (dig.LongWords[0] + dig.LongWords[2] + dig.LongWords[3]) mod m |
71 sc1:= sc2 |
|
72 end; |
71 end; |
73 |
72 |
74 end. |
73 end. |