Skip to content

Commit f604899

Browse files
committed
Now always returning buffer when encrypting
1 parent c22e2ff commit f604899

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/cipher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function encryptIV(rawData) {
2828

2929
var encodeKey = crypto.createHash('sha256').update(PASSWORD, 'utf-8').digest();
3030
var cipher = crypto.createCipheriv(ALGORYTHM, encodeKey, VECTOR);
31-
return cipher.update(rawData, 'utf-8') + cipher.final();
31+
return Buffer.concat([cipher.update(new Buffer.from(rawData)),cipher.final()]);
3232
}
3333

3434
function decryptIV(encData, options) {

0 commit comments

Comments
 (0)