MCPcopy Index your code
hub / github.com/OpenPipe/OpenPipe / hashObject

Function hashObject

app/src/server/utils/hashObject.ts:47–56  ·  view source on GitHub ↗
(obj: JsonValue)

Source from the content-addressed store, hash-verified

45}
46
47export default function hashObject(obj: JsonValue): string {
48 // Sort object keys recursively
49 const sortedObj = sortKeys(obj);
50
51 // Convert to JSON and hash it
52 const str = JSON.stringify(sortedObj);
53 const hash = crypto.createHash("sha256");
54 hash.update(str);
55 return hash.digest("hex");
56}

Callers 5

hashRequestFunction · 0.85
hashNodeFunction · 0.85
hashDatasetEntryInputFunction · 0.85
hashDatasetEntryOutputFunction · 0.85

Calls 1

sortKeysFunction · 0.85

Tested by

no test coverage detected