fix: typo, non-working code

Signed-off-by: SebestikCZ <sebestaad@gmail.com>
This commit is contained in:
SebestikCZ 2022-03-20 17:49:04 +01:00
parent c40b2034d6
commit 1f8b2bca5c
2 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -80,4 +80,4 @@ module.exports = (text, key) => {
returningText = returningText.join("");
return { exitCode: 0, value: returningText };
},
}