Hacker News new | ask | show | jobs
by thusoy 4208 days ago
The easiest version is the most portable and easy to read in this case:

os.urandom(20)

Saves you from having to manage files at all, and works cross-platform.

1 comments

Huh, I never knew that was there; thanks!

In production code I would probably use Crypto.Random.get_random_bytes().