crypt.encode
Table aliases for the Base64 and LZ4 helpers.
Syntax
crypt.encode(data: string) -> string
Parameters
| Parameter | Type | Description |
|---|---|---|
data | string | The data payload to process or send. |
Returns
| Type | Description |
|---|---|
string | The returned string. |
Description
crypt.encode is part of the Crypt library. Crypt functions process data locally. Keys, hashes and encrypted buffers remain inside the process.
The operation is performed immediately using the arguments supplied at the call site.
The aliases crypt.decode(data), crypt.base64encode(data), crypt.base64decode(data), crypt.base64_encode(data), crypt.base64_decode(data), crypt.lz4compress(data), crypt.lz4decompress(data) resolve to the same implementation.
Example
local encoded = crypt.base64encode("hello")
print(crypt.base64decode(encoded))
print(crypt.lz4decompress(crypt.lz4compress("data")))
Notes
- Aliases:
crypt.decode(data),crypt.base64encode(data),crypt.base64decode(data),crypt.base64_encode(data),crypt.base64_decode(data),crypt.lz4compress(data),crypt.lz4decompress(data). - Never log keys or decrypted buffers in production scripts.