pub fn cache_key(
repo_owner: &str,
repo_name: &str,
file_path: &str,
pattern_id: &str,
matched_text: &str,
) -> StringExpand description
Generate a cache key for a security finding.
Creates a SHA-256 hash of the concatenated components:
{repo_owner}/{repo_name}:{file_path}:{pattern_id}:{matched_text}
Uses incremental hashing to avoid allocating a large intermediate string,
which is more memory-efficient when matched_text contains large code snippets.
This ensures that identical findings across scans are cached, while different contexts (repo, file, pattern, or code) produce unique keys.
§Arguments
repo_owner- Repository owner (e.g., “octocat”)repo_name- Repository name (e.g., “hello-world”)file_path- File path where finding was detectedpattern_id- Pattern ID that matchedmatched_text- The matched code snippet
§Returns
A 64-character hexadecimal SHA-256 hash.