2 ms·
Regarding "keep no state", note also that rand() can not reasonably be implemented without some state being maintained between calls (even if it is maintained b
by jstanley 11y ago
Regarding "keep no state", note also that rand() can not reasonably be implemented without some state being maintained between calls (even if it is maintained by the caller e.g. rand_r()).
- pjc50 11y agoWell, yes, but as people are continually rediscovering "randomness" and "provable deterministic behaviour" are really tricky design goals to both meet. At least forcing explicit state makes the caller think slightly about cryptographic randomness. See also the /dev/random vs /dev/urandom wrangling.