bpo-40286: Add randbytes() method to random.Random (GH-19527)
Add random.randbytes() function and random.Random.randbytes() method to generate random bytes. Modify secrets.token_bytes() to use SystemRandom.randbytes() rather than calling directly os.urandom(). Rename also genrand_int32() to genrand_uint32(), since it returns an unsigned 32-bit integer, not a signed integer. The _random module is now built with Py_BUILD_CORE_MODULE defined.
V
Victor Stinner committed
9f5fe7910f4a1bf5a425837d4915e332b945eb7b
Parent: 22386bb
Committed by GitHub <noreply@github.com>
on 4/17/2020, 5:05:35 PM