MCPcopy
hub / github.com/github/spec-kit / _sha256

Function _sha256

src/specify_cli/integrations/manifest.py:20–26  ·  view source on GitHub ↗

Return the hex SHA-256 digest of *path*.

(path: Path)

Source from the content-addressed store, hash-verified

18
19
20def _sha256(path: Path) -> str:
21 """Return the hex SHA-256 digest of *path*."""
22 h = hashlib.sha256()
23 with open(path, "rb") as fh:
24 for chunk in iter(lambda: fh.read(8192), b""):
25 h.update(chunk)
26 return h.hexdigest()
27
28
29def _validate_rel_path(rel: Path, root: Path) -> Path:

Callers 6

test_record_existingMethod · 0.90
_is_managedFunction · 0.85
record_existingMethod · 0.85
check_modifiedMethod · 0.85
uninstallMethod · 0.85

Calls 2

readMethod · 0.45
updateMethod · 0.45