new Crypt(secret)
constructor
Parameters:
Name | Type | Description |
---|---|---|
secret |
string | secret (should be at least 32 characters) |
- Source:
Methods
decrypt(encrypted) → {string}
Decrypt a text
Parameters:
Name | Type | Description |
---|---|---|
encrypted |
string | an encrypted text |
- Source:
Returns:
the text
- Type
- string
encrypt(text) → {string}
Encrypt a text
Parameters:
Name | Type | Description |
---|---|---|
text |
string | a text |
- Source:
Returns:
the encrypted text
- Type
- string