MCPcopy Create free account
hub / github.com/idank/explainshell / _file_sha256_prefix

Function _file_sha256_prefix

explainshell/extraction/common.py:72–77  ·  view source on GitHub ↗
(path: str, length: int = 12)

Source from the content-addressed store, hash-verified

70
71
72def _file_sha256_prefix(path: str, length: int = 12) -> str:
73 h = hashlib.sha256()
74 with open(path, "rb") as f:
75 for chunk in iter(lambda: f.read(8192), b""):
76 h.update(chunk)
77 return h.hexdigest()[:length]
78
79
80def _git_run(args: list[str]) -> subprocess.CompletedProcess[str]:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected