MCPcopy Create free account
hub / github.com/anus-dev/ANUS / getCacheKey

Function getCacheKey

packages/core/src/utils/filesearch/crawlCache.ts:18–30  ·  view source on GitHub ↗
(
  directory: string,
  ignoreContent: string,
  maxDepth?: number,
)

Source from the content-addressed store, hash-verified

16 * or ignore rules change.
17 */
18export const getCacheKey = (
19 directory: string,
20 ignoreContent: string,
21 maxDepth?: number,
22): string => {
23 const hash = crypto.createHash('sha256');
24 hash.update(directory);
25 hash.update(ignoreContent);
26 if (maxDepth !== undefined) {
27 hash.update(String(maxDepth));
28 }
29 return hash.digest('hex');
30};
31
32/**
33 * Reads cached data from the in-memory cache.

Callers 1

crawlCache.test.tsFile · 0.85

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected