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

Function hashSecret

packages/shared/src/crypto.ts:45–47  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

43
44
45export function hashSecret(text: string): string {
46 return crypto.createHmac('sha256', env.SOURCEBOT_ENCRYPTION_KEY).update(text).digest('hex');
47}
48
49export function generateApiKey(): { key: string; hash: string } {
50 const secret = crypto.randomBytes(32).toString('hex');

Callers 9

getAuthenticatedUserFunction · 0.90
getVerifiedApiObjectFunction · 0.90
generateAndStoreAuthCodeFunction · 0.90
verifyAndExchangeCodeFunction · 0.90
revokeTokenFunction · 0.90
generateApiKeyFunction · 0.85
generateOAuthTokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected