MCPcopy Index your code
hub / github.com/algorithmiaio/algorithmia-python / md5_for_file

Function md5_for_file

Algorithmia/util.py:38–43  ·  view source on GitHub ↗
(fname)

Source from the content-addressed store, hash-verified

36
37
38def md5_for_file(fname):
39 hash_md5 = hashlib.md5()
40 with open(fname, "rb") as f:
41 for chunk in iter(lambda: f.read(4096), b""):
42 hash_md5.update(chunk)
43 return str(hash_md5.hexdigest())
44
45
46def md5_for_str(content):

Callers 1

freezeMethod · 0.90

Calls 2

readMethod · 0.80
updateMethod · 0.80

Tested by

no test coverage detected