The DEFAULT_ENTROPY variable used to store the current default random bytes value should be documented for `secrets` module · Issue #78134 · python/cpython · GitHub
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/stevendaprano'closed_at=<Date2020-09-14.14:15:47.875>created_at=<Date2018-06-25.07:59:11.493>labels= ['3.8', 'type-feature', '3.7', '3.9', 'docs']
title='The DEFAULT_ENTROPY variable used to store the current default random bytes value should be documented for `secrets` module'updated_at=<Date2020-09-14.14:15:47.874>user='https://github.com/lig'
Activity
lig commented on Jun 25, 2018
There is the corresponding section on the topic here https://github.com/python/cpython/blob/3.6/Doc/library/secrets.rst#how-many-bytes-should-tokens-use
The current value of 32 bytes is mentioned there correctly.
Unfortunately, there is no way to know which constant in the secrets stores this value.
It is easy to imagine a use case to use say DEFAULT_ENTROPY * 4 in the code and stay updated with the default entropy being increased over time.
Thus, it looks reasonable to document the secrets.DEFAULT_ENTROPY constant in the module docs.