INNER CODE UNIT · Python
_digest
faridrashidi/cnsplots · src/cnsplots/_cli.py:114
def _digest(content: bytes) -> str:
return hashlib.sha256(content).hexdigest()
def _file_digest(destination: Path, name: str) -> str | None:
path = _checked_path(destination, name)
if not path.exists():
return None
if not path.is_file():
raise ValueError(f"expected a managed skill file: {path}")
return _digest(path.read_bytes())
def _read_manifest(destination: Path) -> _Manifest | None:
path = _checked_path(destination, _MANIFEST)
if not path.exists():
return None
try: