A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2016-April/144202.html below:

[Python-Dev] PEP 506 secrets module

[Python-Dev] PEP 506 secrets module [Python-Dev] PEP 506 secrets moduleNick Coghlan ncoghlan at gmail.com
Fri Apr 15 06:42:06 EDT 2016
On 15 April 2016 at 19:39, Victor Stinner <victor.stinner at gmail.com> wrote:
> Hi,
>
> Would it make sense to add a function to generate a random UUID4 (as a
> string) in secrets?
>
> The current implement in uuid.py of CPython 3.6 already uses os.urandom():
>
> def uuid4():
>     """Generate a random UUID."""
>     return UUID(bytes=os.urandom(16), version=4)

I don't think so, as folks looking to generate a UUID specifically are
already likely to end up at the uuid module docs rather than trying to
craft their own based on the random module (and the uuid module
already does the right thing, and it would be a bug if it didn't).

The new secrets module fills the gap for cases where random is
otherwise an attractive nuisance by making it easy to say "use this
instead".

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4