MCPcopy Create free account
hub / github.com/aboutcode-org/vulnerablecode / sha256_digest

Function sha256_digest

vulnerabilities/utils.py:639–643  ·  view source on GitHub ↗

Return SHA256 digest from normalized data.

(normalized_data)

Source from the content-addressed store, hash-verified

637
638
639def sha256_digest(normalized_data):
640 """Return SHA256 digest from normalized data."""
641
642 normalized_json = json.dumps(normalized_data, separators=(",", ":"), sort_keys=True)
643 return hashlib.sha256(normalized_json.encode("utf-8")).hexdigest()
644
645
646def compute_content_id(advisory_data):

Calls

no outgoing calls

Tested by

no test coverage detected