MCPcopy
hub / github.com/Doorman11991/smallcode / _hash

Method _hash

src/tools/dedup.js:84–87  ·  view source on GitHub ↗

* Compute a stable hash for (toolName, args). Uses sorted JSON to be * insensitive to argument-key order.

(name, args)

Source from the content-addressed store, hash-verified

82 * insensitive to argument-key order.
83 */
84 _hash(name, args) {
85 const norm = JSON.stringify(args || {}, Object.keys(args || {}).sort());
86 return crypto.createHash('sha1').update(name + '|' + norm).digest('hex').slice(0, 16);
87 }
88
89 /**
90 * Check whether (name, args) was just executed. Returns the cached result

Callers 2

lookupMethod · 0.95
recordMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected