Convert string to hash object of cryptography library.
(digest='sha256')
| 11 | |
| 12 | |
| 13 | def get_digest_algorithm(digest='sha256'): |
| 14 | """Convert string to hash object of cryptography library.""" |
| 15 | assert digest is not None |
| 16 | return getattr(hashes, digest.upper())() |
| 17 | |
| 18 | |
| 19 | @contextmanager |
no outgoing calls