We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
same as https://dlang.org/library/std/random/unpredictable_seed.html
EDIT just figured that nim has this:
proc randomize*() {.benign.} = let now = times.getTime() randomize(convert(Seconds, Nanoseconds, now.toUnix) + now.nanosecond)
this could be improved for more randomness, as done here: https://github.com/dlang/phobos/blob/v2.081.1/std/random.d#L1549 which mixes pid, threadid, and time
pid
threadid
time
if (!seeded) { uint threadID = cast(uint) cast(void*) Thread.getThis(); rand.seed((getpid() + threadID) ^ cast(uint) MonoTime.currTime.ticks); seeded = true; } rand.popFront(); return cast(uint) (MonoTime.currTime.ticks ^ rand.front);
The text was updated successfully, but these errors were encountered:
I don't see any significant benefit of "more randomness". Closing as rejected.
Sorry, something went wrong.
No branches or pull requests
same as https://dlang.org/library/std/random/unpredictable_seed.html
EDIT
just figured that nim has this:
this could be improved for more randomness, as done here: https://github.com/dlang/phobos/blob/v2.081.1/std/random.d#L1549
which mixes
pid
,threadid
, andtime
minor
The text was updated successfully, but these errors were encountered: