Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
queicherius committed Dec 5, 2024
1 parent f549970 commit 702a07f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ export function decrypt(key: string, input: string): string {
const keyBuffer = Buffer.from(key)
const inputBuffer = Buffer.from(input, 'base64')

const iv = inputBuffer.slice(0, 16)
const tag = inputBuffer.slice(16, 32)
const text = inputBuffer.slice(32)
const iv = inputBuffer.subarray(0, 16)
const tag = inputBuffer.subarray(16, 32)
const text = inputBuffer.subarray(32)

const decipher = crypto.createDecipheriv('aes-256-gcm', keyBuffer, iv)
decipher.setAuthTag(tag)

const decrypted = decipher.update(text) + decipher.final('utf8')
const decrypted = decipher.update(text).toString() + decipher.final('utf8')

return decrypted
}

0 comments on commit 702a07f

Please sign in to comment.