(value: string)
| 74 | }; |
| 75 | |
| 76 | const 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 | |
| 87 | const operationKey = (integration: string, toolName: string): string => |
| 88 | `${OPERATION_KEY_VERSION}.${stableKeyHash(integration)}.${stableKeyHash(toolName)}`; |
no test coverage detected