MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / decryptPromoCode

Function decryptPromoCode

apps/web/src/lib/promoCreditEncryption.ts:30–36  ·  view source on GitHub ↗
(encrypted: string)

Source from the content-addressed store, hash-verified

28
29/**
30 * Decrypts an encrypted promo code.
31 * Used at runtime to decrypt promo codes stored in source.
32 *
33 * @param encrypted - Encrypted string in format iv:authTag:encrypted
34 * @returns The original plaintext promo code
35 */
36export function decryptPromoCode(encrypted: string): string {
37 if (
38 process.env.NODE_ENV === 'test' ||
39 (!CREDIT_CATEGORIES_ENCRYPTION_KEY_V2 && !CREDIT_CATEGORIES_ENCRYPTION_KEY)

Callers 1

Calls 3

decryptWithSymmetricKeyFunction · 0.90
getEncryptionKeyFunction · 0.85
toStringMethod · 0.65

Tested by

no test coverage detected