File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ var constant_time_compare = function (val1, val2) {
39
39
module . exports = {
40
40
41
41
"encrypt" : function ( plain_text ) {
42
- if ( ! plain_text || typeof ( plain_text ) !== "string" ) return Promise . reject ( "Plain text not found." ) ;
42
+ if ( ! plain_text || typeof ( plain_text ) !== "string" ) return Promise . reject ( "Plain text was not found." ) ;
43
43
44
44
var IV = Buffer . from ( randomValueHex ( 16 ) ) ; // ensure that the IV (initialization vector) is random
45
45
var encryptor , cipher_text , hmac ;
@@ -60,7 +60,7 @@ module.exports = {
60
60
} ,
61
61
62
62
"decrypt" : function ( cipher_text ) {
63
- if ( ! cipher_text || typeof ( cipher_text ) !== "string" || ! cipher_text . match ( "$" ) ) return Promise . reject ( "A valid cipher text not found." ) ;
63
+ if ( ! cipher_text || typeof ( cipher_text ) !== "string" || ! cipher_text . match ( / \$ / g ) ) return Promise . reject ( "A valid cipher text was not found." ) ;
64
64
65
65
var cipher_blob = cipher_text . split ( "$" ) ;
66
66
var ct = cipher_blob [ 0 ] ;
You can’t perform that action at this time.
0 commit comments