Skip to content

Commit cfb9bb4

Browse files
committed
fixes and stuff
1 parent 1eb24a5 commit cfb9bb4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

basic256.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var constant_time_compare = function (val1, val2) {
3939
module.exports = {
4040

4141
"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.");
4343

4444
var IV = Buffer.from(randomValueHex(16)); // ensure that the IV (initialization vector) is random
4545
var encryptor, cipher_text, hmac;
@@ -60,7 +60,7 @@ module.exports = {
6060
},
6161

6262
"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.");
6464

6565
var cipher_blob = cipher_text.split("$");
6666
var ct = cipher_blob[0];

0 commit comments

Comments
 (0)