| 222 | salt_entropy = 128 |
| 223 | |
| 224 | def _load_library(self): |
| 225 | if self.library is not None: |
| 226 | if isinstance(self.library, (tuple, list)): |
| 227 | name, mod_path = self.library |
| 228 | else: |
| 229 | mod_path = self.library |
| 230 | try: |
| 231 | module = importlib.import_module(mod_path) |
| 232 | except ImportError as e: |
| 233 | raise ValueError( |
| 234 | "Couldn't load %r algorithm library: %s" |
| 235 | % (self.__class__.__name__, e) |
| 236 | ) |
| 237 | return module |
| 238 | raise ValueError( |
| 239 | "Hasher %r doesn't specify a library attribute" % self.__class__.__name__ |
| 240 | ) |
| 241 | |
| 242 | def salt(self): |
| 243 | """ |