MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / generateApiKey

Function generateApiKey

packages/shared/src/crypto.ts:49–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47}
48
49export function generateApiKey(): { key: string; hash: string } {
50 const secret = crypto.randomBytes(32).toString('hex');
51 const hash = hashSecret(secret);
52
53 return {
54 key: `${API_KEY_PREFIX}${secret}`,
55 hash,
56 };
57}
58
59export function generateOAuthToken(): { token: string; hash: string } {
60 const secret = crypto.randomBytes(32).toString('hex');

Callers 1

createApiKeyFunction · 0.90

Calls 1

hashSecretFunction · 0.85

Tested by

no test coverage detected