MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _content_digest

Function _content_digest

graphify/cache.py:594–601  ·  view source on GitHub ↗

SHA256 of ``raw`` (frontmatter-stripped for Markdown) plus the salt.

(raw: bytes, salt: str, suffix: str)

Source from the content-addressed store, hash-verified

592
593
594def _content_digest(raw: bytes, salt: str, suffix: str) -> str:
595 """SHA256 of ``raw`` (frontmatter-stripped for Markdown) plus the salt."""
596 content = _body_content(raw) if suffix == ".md" else raw
597 h = hashlib.sha256()
598 h.update(content)
599 h.update(b"\x00")
600 h.update(salt.encode())
601 return h.hexdigest()
602
603
604def file_hash(

Callers 2

file_hashFunction · 0.85

Calls 2

_body_contentFunction · 0.85
updateMethod · 0.80

Tested by

no test coverage detected