Patch #934711: Expose platform-specific entropy.

This commit is contained in:
Martin v. Löwis 2004-08-29 15:46:35 +00:00
parent 6ab78cd0c0
commit dc3883f671
5 changed files with 126 additions and 1 deletions

View file

@ -1828,3 +1828,22 @@ Macintosh.
Also available via \module{os.path}.
\versionadded{2.4}
\end{datadesc}
\subsection{Miscellaneous Functions \label{os-miscfunc}}
\begin{funcdesc}{urandom}{n}
Return a string of \var{n} random bytes suitable for cryptographic use.
This function returns random bytes from an OS-specific
randomness source. The returned data should be unpredictable enough for
cryptographic applications, though its exact quality depends on the OS
implementation. On a UNIX-like system this will query /dev/urandom, and
on Windows it will use CryptGenRandom. If a randomness source is not
found, \exception{NotImplementedError} will be raised.
\versionadded{2.4}
\end{funcdesc}