Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
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
38
def
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
46
def
md5_for_str(content):
Callers
1
freeze
Method · 0.90
Calls
2
read
Method · 0.80
update
Method · 0.80
Tested by
no test coverage detected