[fpc-pascal] Why is Random(255) some 529x slower compared to Delphi 7?

Jonas Maebe jonas.maebe at elis.ugent.be
Fri Dec 9 11:42:37 CET 2011


On 09 Dec 2011, at 09:39, Graeme Geldenhuys wrote:

> Looking at the code again, I have no idea how it will affect the
> encryption algorithm if I move the assignment to RandSeed outside the
> loop

It will improve the randomness of the generated numbers. Changing the  
random seed all the time removes any properties the random generator  
normally has. In other words, the original code is wrong.


Jonas



More information about the fpc-pascal mailing list