Skip to content

Commit 2f2be18

Browse files
author
lucifer
committed
utf
1 parent 565ab8a commit 2f2be18

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

routes/users.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ function encrypt(text) {
1919

2020
const encrypted = Buffer.concat([cipher.update(text), cipher.final()]);
2121

22-
return encrypted.toString("utf8");
22+
return encrypted.toString("hex");
2323
}
2424

2525
function decrypt(content) {
2626
const decipher = crypto.createDecipheriv(algorithm, secret.slice(0, 32), iv);
2727

2828
const decrpyted = Buffer.concat([
29-
decipher.update(Buffer.from(content, "utf8")),
29+
decipher.update(Buffer.from(content, "hex")),
3030
decipher.final(),
3131
]);
3232

0 commit comments

Comments
 (0)