3 ms·
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.
by thusoy 12y 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.
- schoen 12y agoHuh, I never knew that was there; thanks! In production code I would probably use Crypto.Random.get_random_bytes().