Hacker News new | past | comments | ask | show | jobs | submit login

For "Arc4Random" it says "Reproducible Results: Not Always".

Can an algorithm really produce a non-reproducible result?




https://www.pcg-random.org/other-rngs.html#arc4random explains what they meant:

> The BSD implementations (which are the only widely used ones) have several additional issues

> • No facility for a user-provided seed, preventing programs from getting reproducible results

> • Periodically “stirs” the generator using kernel-provided entropy; this code must be removed if reproducible results desired (and is removed from the C++ adaptation I created for testing purposes)


Thanks for the info. I wonder why the openssl implementation wasn't used:

https://stackoverflow.com/q/9329631/830749


Depends on what you're counting for determinism. Arc4Random uses the system entropy pool, so it's non-deterministic from a user perspective.

In a more direct sense, yes. If you're allowed to keep secrets (like internal state), it's possible to produce random numbers algorithmically for certain (weak) definitions of random, even with a deterministic machine. A simple example of this would be sequential bits of a normal number. As you strengthen your definition of randomness you pretty quickly get into non-computable territory though.


There are implementations of Arc4Random which introduce entropy during generation. So, it's not a design feature of the algorithm as much as it is an implementation detail.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: