Return a hasher instance for a checksum algorithm ``name`` with a planned ``total_length`` of bytes to hash.
(name, total_length=0)
| 199 | |
| 200 | |
| 201 | def get_hasher_instance_by_name(name, total_length=0): |
| 202 | """ |
| 203 | Return a hasher instance for a checksum algorithm ``name`` with a planned ``total_length`` of |
| 204 | bytes to hash. |
| 205 | """ |
| 206 | try: |
| 207 | hm = _hashmodules_by_name[name] |
| 208 | return hm(total_length=total_length) |
| 209 | except KeyError: |
| 210 | raise ValueError(f"Unknown checksum algorithm: {name!r}") |
| 211 | |
| 212 | |
| 213 | def get_file_size(location): |
no outgoing calls
no test coverage detected