(self, name, implementation)
| 886 | return default |
| 887 | |
| 888 | def fetch_hash_function(self, name, implementation): |
| 889 | info = hashlib_helper.get_hash_func_info(name) |
| 890 | match hashlib_helper.Implementation(implementation): |
| 891 | case hashlib_helper.Implementation.hashlib: |
| 892 | method_name = info.hashlib.member_name |
| 893 | assert isinstance(method_name, str), method_name |
| 894 | return getattr(self.hashlib, method_name) |
| 895 | case hashlib_helper.Implementation.openssl: |
| 896 | method_name = info.openssl.member_name |
| 897 | assert isinstance(method_name, str | None), method_name |
| 898 | return getattr(self._hashlib, method_name or "", None) |
| 899 | fullname = info[implementation].fullname |
| 900 | return self.try_import_attribute(fullname) |
| 901 | |
| 902 | def fetch_hmac_function(self, name): |
| 903 | target = hashlib_helper.get_hmac_item_info(name) |
no test coverage detected