March 04, 2013 Re: unpredictableSeed | ||||
---|---|---|---|---|
| ||||
Posted in reply to Rob T | 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... :)
|
March 04, 2013 Re: unpredictableSeed | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrea Fontana | On 03/04/2013 09:58 AM, Andrea Fontana wrote:
> Maybe you can try to connect an external hardware device (e.g. arduino) and read
> some params from real world... :)
Yes, there are nice options here ... :-)
However, to re-focus the discussion -- I'm not so much asking "How do I ensure my own code is statistically safe?", as there are lots of ways I can go about that. I'm concerned with the theoretical and practical justification for Phobos' existing unpredictableSeed, and possible superior alternatives that could reasonably be implemented _for Phobos_.
|
March 04, 2013 Re: unpredictableSeed | ||||
---|---|---|---|---|
| ||||
Posted in reply to Joseph Rushton Wakeling | On Monday, 4 March 2013 at 11:04:46 UTC, Joseph Rushton Wakeling wrote: > On 03/04/2013 09:58 AM, Andrea Fontana wrote: >> Maybe you can try to connect an external hardware device (e.g. arduino) and read >> some params from real world... :) > > Yes, there are nice options here ... :-) > > However, to re-focus the discussion -- I'm not so much asking "How do I ensure my own code is statistically safe?", as there are lots of ways I can go about that. I'm concerned with the theoretical and practical justification for Phobos' existing unpredictableSeed, and possible superior alternatives that could reasonably be implemented _for Phobos_. I found this which seems to be what Phobos duplicates http://www.cryptosys.net/rng_algorithms_old.html The theory appears to be no more than an ad-hoc attempt to find something unique and hard to predict across threads, processes and machines. The superseded and improved version uses a hash of more potentially unique values http://www.cryptosys.net/rng_algorithms.html Clearly we're lacking a real solution, and IMO the solution should be hardware devices that come with standardized random generators. --rt |
Copyright © 1999-2021 by the D Language Foundation