(code: string)
| 229 | } |
| 230 | |
| 231 | export function encryptActivationCode(code: string): string { |
| 232 | const { iv, encryptedData } = encrypt(code); |
| 233 | return Buffer.from(JSON.stringify({ iv, encryptedData })).toString('base64'); |
| 234 | } |
| 235 | |
| 236 | export function decryptActivationCode(encrypted: string): string { |
| 237 | const { iv, encryptedData } = JSON.parse(Buffer.from(encrypted, 'base64').toString('utf8')); |
no test coverage detected