We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
binascii.b2a_base64(os.urandom(24))[:-1] is faster and much secure since:
binascii.b2a_base64(os.urandom(24))[:-1]
64**24 = 2**144
256**16 = 2**128
it needs to be checked for special symbols like / and +
/
+
The text was updated successfully, but these errors were encountered:
Thanks for your comment. in my opinion, slash and plus are legal in cookies' value. What is the risk for generate token with base64 directly?
Sorry, something went wrong.
base64 is just a way to encode binary value. It have nothing common with generating random data.
If you ask about base64 module — it is just wrapper over binascii module — see sources. Using binascii directly is just faster in you case.
this feature is added in version 1.1.5, thank you for your suggestion.
No branches or pull requests
binascii.b2a_base64(os.urandom(24))[:-1]
is faster and much secure since:64**24 = 2**144
random items, while your way generates256**16 = 2**128
variantsit needs to be checked for special symbols like
/
and+
The text was updated successfully, but these errors were encountered: