Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit af1edb7

Browse files
committed
merge with 3.3
2 parents 4f198de + c6a2c9b commit af1edb7

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

Doc/library/os.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3377,8 +3377,9 @@ Miscellaneous Functions
33773377
This function returns random bytes from an OS-specific randomness source. The
33783378
returned data should be unpredictable enough for cryptographic applications,
33793379
though its exact quality depends on the OS implementation. On a Unix-like
3380-
system this will query /dev/urandom, and on Windows it will use CryptGenRandom.
3381-
If a randomness source is not found, :exc:`NotImplementedError` will be raised.
3380+
system this will query ``/dev/urandom``, and on Windows it will use
3381+
``CryptGenRandom()``. If a randomness source is not found,
3382+
:exc:`NotImplementedError` will be raised.
33823383

33833384
For an easy-to-use interface to the random number generator
33843385
provided by your platform, please see :class:`random.SystemRandom`.

Python/random.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,9 @@ lcg_urandom(unsigned int x0, unsigned char *buffer, size_t size)
218218
}
219219
}
220220

221-
/* Fill buffer with size pseudo-random bytes, not suitable for cryptographic
222-
use, from the operating random number generator (RNG).
221+
/* Fill buffer with size pseudo-random bytes from the operating system random
222+
number generator (RNG). It is suitable for for most cryptographic purposes
223+
except long living private keys for asymmetric encryption.
223224
224225
Return 0 on success, raise an exception and return -1 on error. */
225226
int

0 commit comments

Comments
 (0)