-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
New issue
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
hashlib : the names of the different hash algorithms #51667
Comments
Hi, The hashlib module could provide a tuple offering the names of the The expected result: >>> import hashlib
>>> hashlib.algorithms
('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512') Here is a patch to do so. It also provides an update for the hashlib Bye, |
I guess you missed the quotes. $ ./python foo.py
Traceback (most recent call last):
File "foo.py", line 2, in <module>
from hashlib import *
TypeError: attribute name must be string, not 'tuple' |
flox : You're right, sorry about that. Here is a fixed patch. |
The fixed file : |
Hi, Maybe you have some ideas on this patch? I think it could be a nice
'sha224','sha256','sha384','sha512'): And it would be better if this tuple could be provided by the hashlib |
I'll be taking a look at this patch during the sprints at Pycon. Will get back to you soonish :-) |
1 similar comment
I'll be taking a look at this patch during the sprints at Pycon. Will get back to you soonish :-) |
applied, it'll appear in 2.7 and 3.2. r78528 and r78529. |
Could the module also grow an attribute listing all available algos, or non-guaranteed algos? (Please tell me if I should open a new report.) |
Sounds like a good idea. frozensets for both. |
Thanks for the reply. Reopening. I cannot propose a patch since I don’t know how to introspect OpenSSL (or how to write C, for that matter). |
Implemented in py3k r84554. |
Great, thank you! |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: