MCPcopy Index your code
hub / github.com/Tencent/CodeAnalysis / get_sha256

Method get_sha256

client/util/api/fileserver.py:39–47  ·  view source on GitHub ↗
(file_path)

Source from the content-addressed store, hash-verified

37
38 @staticmethod
39 def get_sha256(file_path):
40 sha256 = hashlib.sha256()
41 with open(file_path, 'rb') as f:
42 while True:
43 data = f.read(4096)
44 if not data:
45 break
46 sha256.update(data)
47 return sha256.hexdigest()
48
49
50class FileServer(object):

Callers 1

upload_fileMethod · 0.80

Calls 2

readMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected