fix: typo, non-working code
Signed-off-by: SebestikCZ <sebestaad@gmail.com>
This commit is contained in:
parent
c40b2034d6
commit
1f8b2bca5c
12
README.md
12
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
|
||||
|
@ -80,4 +80,4 @@ module.exports = (text, key) => {
|
||||
|
||||
returningText = returningText.join("");
|
||||
return { exitCode: 0, value: returningText };
|
||||
},
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user