I'm not sure this is in scope for the cryptography package, but while the int.from_bytes(os.random(num_bytes))
recipe is fairly clear for securely generating a random integer, it's not particularly how to safely generate a secure text token based on os.urandom data.
Pyramid apparently uses binascii.hexlify(os.urandom(n))
for secure token generation, while Django uses random = random.SystemRandom(); ''.join(random.choice(alphabet) for _ in range(n))
This is a common source of recommendations to use the standard library's random module, and I'm not aware of any standalone third party packages that cover it (it's not part of cryptography, passlib, or itsdangerous, which where the ones I checked)
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