(file_path)
| 26 | class FlieHash(object): |
| 27 | @staticmethod |
| 28 | def get_md5(file_path): |
| 29 | md5 = hashlib.md5() |
| 30 | with open(file_path, 'rb') as f: |
| 31 | while True: |
| 32 | data = f.read(4096) |
| 33 | if not data: |
| 34 | break |
| 35 | md5.update(data) |
| 36 | return md5.hexdigest() |
| 37 | |
| 38 | @staticmethod |
| 39 | def get_sha256(file_path): |
no test coverage detected