MCPcopy Create free account
hub / github.com/FlashpointProject/launcher / hash_file

Function hash_file

extern/utils/sourceBuild.py:6–13  ·  view source on GitHub ↗
(file_path: str)

Source from the content-addressed store, hash-verified

4BLOCKSIZE = 65536
5
6def 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
15def hash_all_files():
16 with open('output.source', 'w') as outfile:

Callers 1

hash_all_filesFunction · 0.85

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected