Sadly, this one is too long for a tweet until next year when twitter decides that we need more space to offend one another, so for now, bookmark this page http://www.keithschwarz.com/darts-dice-coins/ … , or print it out and frame it in case the Internet ever dies. It's one of the best bits.
-
-
Third: always use a secure RNG, your language or programming environment should have one. *Don't* ever seed an RNG yourself. One exception: for fuzz inputs and other tests, where you may want repeat deterministically for debugging. But DON'T LET IT LEAK INTO PRODUCTION.
Show this thread -
Another exception is games, where you may want to generate content and play based on a small seed value, BUT UNDERSTAND THAT THIS IS NOT SECURE.
Show this thread -
Last tip: always measure your little random functions with a histogram or whatever. I still code these wrong and have to check. Thanks for reading!
Show this thread
End of conversation
New conversation -
-
-
Are you saying to avoid urandom? I use it for my RPi passphrase generator and it's great https://penfold.fr
-
Using urandom is a great default. If you don't need extreme performance, and you can rely on the kernel being up to date and patched, it's a great way to go.
End of conversation
New conversation -
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
all this and you don't mention arc4random_uniform et al?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.