unpredictableSeed

Andrea Fontana nospam at example.com
Mon Mar 4 00:58:01 PST 2013


On Monday, 4 March 2013 at 04:18:10 UTC, Rob T wrote:
> On Saturday, 2 March 2013 at 17:40:58 UTC, Joseph Rushton 
> Wakeling wrote:
>> Hello all,
>>
>> Can anyone advise on the theoretical basis for the 
>> unpredictableSeed method in std.random?  I've tried googling 
>> around for the theory of good thread-safe seed generation 
>> methods but haven't really found anything. :-(
>>
>> Thanks & best wishes,
>>
>>    -- Joe
>
> You can use the real time clock, which should have nanosecond 
> precision. It should be very hard to predict because the clock 
> will fluctuate based on environmental factors. I don't know if 
> all architectures have an adequate real time clock however if 
> portability is needed.
>
> --rt

Maybe you can try to connect an external hardware device (e.g. 
arduino) and read some params from real world... :)


More information about the Digitalmars-d-learn mailing list