a script to securely encode / decode strings
you need to instantiate the WaEncrypt class, something like: const encrypt = new WaEncrypt()
using the previous example of instantiation we call the encode method of the class, this method takes two arguments in the form of a string, the first is a secret and the second a string that you want to encode:
const encrypt = new WaEncrypt()
encrypt.encode('mySecret', 'my text that i want encode')
using a secret literally like 'mySecret' and the literal text 'my string that i want encode', the class return the string :
8G tg)t t0vt 7 dvnt gnu6#g37/735vug85v4vhgqq{8
Take the previous example, now we can use a method decode of the class, this method take two arguments too, the first is your secret used to encode and the second is the encoded string:
const encrypt = new WaEncrypt()
encrypt.decode('mySecret', '8G tg)t t0vt 7 dvnt gnu6#g37/735vug85v4vhgqq{8')
and the return is : 'my text that i want encode'
It's important that you use a very scrambled string to be your secret
If you use the wrong secret an object with an error will be show : {message: "Invalid secret"}