toString clearText
This commit is contained in:
@@ -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'),
|
||||||
|
|||||||
Reference in New Issue
Block a user