MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / stableHash

Function stableHash

packages/plugins/openapi/src/sdk/definitions.ts:224–231  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

222// ---------------------------------------------------------------------------
223
224const stableHash = (value: unknown): string => {
225 const str = JSON.stringify(value, Object.keys(value as Record<string, unknown>).sort());
226 let hash = 0;
227 for (let i = 0; i < str.length; i++) {
228 hash = ((hash << 5) - hash + str.charCodeAt(i)) | 0;
229 }
230 return Math.abs(hash).toString(36).padStart(8, "0");
231};
232
233// ---------------------------------------------------------------------------
234// Main entry point

Callers 1

planToolPathsFunction · 0.85

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected