commit | 9f5fe7910f4a1bf5a425837d4915e332b945eb7b | [log] [tgz] |
---|---|---|
author | Victor Stinner <vstinner@python.org> | Fri Apr 17 19:05:35 2020 +0200 |
committer | GitHub <noreply@github.com> | Fri Apr 17 19:05:35 2020 +0200 |
tree | 5f652699332e33a81cf6baa5ff5b6fecadea1903 | |
parent | 22386bb4ef740ee92d34c87b8cb90d681423a853 [diff] |
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.