toString clearText

This commit is contained in:
Tarrgon
2026-06-30 13:35:28 -04:00
parent c606a69eac
commit 18c550ecda
+1 -1
View File
@@ -77,7 +77,7 @@ class Encrypter {
static encrypt(clearText) { static encrypt(clearText) {
const iv = crypto.randomBytes(16); const iv = crypto.randomBytes(16);
const cipher = crypto.createCipheriv(this.algorithm, this.key, iv); const cipher = crypto.createCipheriv(this.algorithm, this.key, iv);
const encrypted = cipher.update(clearText, 'utf8', 'hex'); const encrypted = cipher.update(clearText.toString(), 'utf8', 'hex');
return [ return [
encrypted + cipher.final('hex'), encrypted + cipher.final('hex'),
Buffer.from(iv).toString('hex'), Buffer.from(iv).toString('hex'),