Skip to content
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

SHA1 digest to be a property of _Base class #30

Closed
vladak opened this issue Jun 5, 2018 · 2 comments
Closed

SHA1 digest to be a property of _Base class #30

vladak opened this issue Jun 5, 2018 · 2 comments

Comments

@vladak
Copy link

vladak commented Jun 5, 2018

I use the pem library to compare 2 sets of certificate bundles. To quickly see what are the differences, it would be handy if the SHA1 digest was part of the _Base class so it does not have to be recomputed, i.e. so this is possible:

import pem
certs = pem.parse_file("cacert-2018-03-07.pem")
# print(hashlib.sha1(certs[0].as_bytes()).hexdigest())
print(certs[0].sha1) # avoids double digest computation
@hynek
Copy link
Owner

hynek commented Jun 16, 2018

Hm computing them unconditionally seems unwise, maybe make it a cached property?

@vladak
Copy link
Author

vladak commented Jun 16, 2018 via email

@hynek hynek closed this as completed in 5094c0f Jun 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants