(file_path: str)
| 4 | BLOCKSIZE = 65536 |
| 5 | |
| 6 | def hash_file(file_path: str): |
| 7 | shash = hashlib.sha256() |
| 8 | with open(file_path, 'rb') as f: |
| 9 | buf = f.read(BLOCKSIZE) |
| 10 | while len(buf) > 0: |
| 11 | shash.update(buf) |
| 12 | buf = f.read(BLOCKSIZE) |
| 13 | return shash.hexdigest() |
| 14 | |
| 15 | def hash_all_files(): |
| 16 | with open('output.source', 'w') as outfile: |
no test coverage detected