From 2d6bb0bd96190ee504f9e8c215bb3a7ed56358f2 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Thu, 18 Dec 2014 21:31:28 -0800 Subject: Let people who are curious know how os.urandom is implemented --- docs/random-numbers.rst | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs') diff --git a/docs/random-numbers.rst b/docs/random-numbers.rst index 68a72cf7..5113afd2 100644 --- a/docs/random-numbers.rst +++ b/docs/random-numbers.rst @@ -18,4 +18,7 @@ can obtain them with: >>> import os >>> iv = os.urandom(16) +This will use ``/dev/urandom`` on UNIX platforms, and ``CryptGenRandom`` on +Windows. + .. _`always use your operating system's provided random number generator`: http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/ -- cgit v1.2.3 From ae7dfce5a383c6f3cb79f49ad728e9b642d6aaa7 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Thu, 18 Dec 2014 23:48:33 -0800 Subject: Attempt to link to the os.urandom docs from upstream --- docs/random-numbers.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/random-numbers.rst b/docs/random-numbers.rst index 5113afd2..8b119a3e 100644 --- a/docs/random-numbers.rst +++ b/docs/random-numbers.rst @@ -9,9 +9,9 @@ provide a cryptographically secure random number generator, which can result in major security issues depending on the algorithms in use. Therefore, it is our recommendation to `always use your operating system's -provided random number generator`_, which is available as ``os.urandom()``. For -example, if you need 16 bytes of random data for an initialization vector, you -can obtain them with: +provided random number generator`_, which is available as :func:`os.urandom`. +For example, if you need 16 bytes of random data for an initialization vector, +you can obtain them with: .. doctest:: -- cgit v1.2.3