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

Function stableKeyHash

packages/plugins/openapi/src/sdk/store.ts:76–85  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

74};
75
76const stableKeyHash = (value: string): string => {
77 let hash = 0xcbf29ce484222325n;
78 const prime = 0x100000001b3n;
79 const mask = 0xffffffffffffffffn;
80 for (let index = 0; index < value.length; index += 1) {
81 hash ^= BigInt(value.charCodeAt(index));
82 hash = (hash * prime) & mask;
83 }
84 return hash.toString(36).padStart(13, "0");
85};
86
87const operationKey = (integration: string, toolName: string): string =>
88 `${OPERATION_KEY_VERSION}.${stableKeyHash(integration)}.${stableKeyHash(toolName)}`;

Callers 1

operationKeyFunction · 0.70

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected