From 1f8b2bca5cc101feaa996cfddc1d67475c7d1de6 Mon Sep 17 00:00:00 2001 From: SebestikCZ Date: Sun, 20 Mar 2022 17:49:04 +0100 Subject: [PATCH] fix: typo, non-working code Signed-off-by: SebestikCZ --- README.md | 12 ++++++------ src/decrypter.js | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 23b1bc2..1182654 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # WHY2 Encryption System -*Yeah.* - ### Table of contents - [Using in Your projects](#using-in-your-projects) @@ -20,14 +18,15 @@ To **decrypt** text, use function `decrypt()` from file `./index.js`. - Encryption: ```js - const { encrypt, decrypt } = require("why2-encryption-system.js"); + const { encrypt } = require("why2-encryption-system.js"); //FIRST VARIANT - var yourText = encryptText("Put here text, you want encrypt...", "tzXlZGxkhfYOvRthqokDrmGFyDMylgmeIlrJTpVAwuqrLjABXM"); //The second thing is Your **key**. (The key must be atleast 50 characters long!) + var yourText = await encrypt("Put here text, you want encrypt...", "tzXlZGxkhfYOvRthqokDrmGFyDMylgmeIlrJTpVAwuqrLjABXM"); //The second thing is Your **key**. (The key must be atleast 50 characters long!) //SECOND VARIANT - var yourText = encryptText("Put here text, you want encrypt..."); //See? You don't have to use Your key. Program will automatically generate one for you. + var yourText = await encrypt("Put here text, you want encrypt..."); //See? You don't have to use Your key. Program will automatically generate one for you. ``` **WARNING!** The key from encryption will be printed out along the text value as an object \ +**The method needs to be awaited, due to `crypto` randomizer.** _Note: exit codes \ `-2` - invalid key \ `0` - operation completed successfully \ @@ -35,7 +34,8 @@ _Note: exit codes \ - Decryption: ```js - char *yourText = decryptText("158.-83.9388.-14.57.8419.113.-98.10576", "tzXlZGxkhfYOvRthqokDrmGFyDMylgmeIlrJTpVAwuqrLjABXM"); //First parameter is Your encrypted text, the second is key you want to use for decryption. + const { decrypt } = require("why2-encryption-system.js"); + var yourText = decrypt("158.-83.9388.-14.57.8419.113.-98.10576", "tzXlZGxkhfYOvRthqokDrmGFyDMylgmeIlrJTpVAwuqrLjABXM"); //First parameter is Your encrypted text, the second is key you want to use for decryption. ``` ## Example programs diff --git a/src/decrypter.js b/src/decrypter.js index c78b9b6..5e10c70 100644 --- a/src/decrypter.js +++ b/src/decrypter.js @@ -80,4 +80,4 @@ module.exports = (text, key) => { returningText = returningText.join(""); return { exitCode: 0, value: returningText }; - }, \ No newline at end of file + } \ No newline at end of file