2
0
Files
bot/packages/lib/api/encryption/decrypt.ts
2023-10-06 17:45:12 +02:00

11 lines
286 B
TypeScript

import { decryptV1 } from './decryptV1'
import { decryptV2 } from './decryptV2'
export const decrypt = async (
encryptedData: string,
ivHex: string
): Promise<object> => {
if (ivHex.length !== 24) return decryptV1(encryptedData, ivHex)
return decryptV2(encryptedData, ivHex)
}