From 235d8ffdd184072f05b36d32c23c13b7bcc4ee85 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 5 Oct 2024 15:58:32 +0530 Subject: [PATCH] feat: missing exports --- server/src/utils/auth.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/utils/auth.ts b/server/src/utils/auth.ts index d428d414..b1f6850f 100644 --- a/server/src/utils/auth.ts +++ b/server/src/utils/auth.ts @@ -23,7 +23,7 @@ export const comparePassword = (password: string, hash: string): Promise { +export const encrypt = (text: string): string => { const ivLength = parseInt(getEnvVariable('IV_LENGTH'), 10); const iv = crypto.randomBytes(ivLength); const algorithm = getEnvVariable('ALGORITHM'); @@ -34,7 +34,7 @@ const encrypt = (text: string): string => { return `${iv.toString('hex')}:${encrypted}`; }; -const decrypt = (encryptedText: string): string => { +export const decrypt = (encryptedText: string): string => { const [iv, encrypted] = encryptedText.split(':'); const algorithm = getEnvVariable('ALGORITHM'); const key = Buffer.from(getEnvVariable('ENCRYPTION_KEY'), 'hex');