Syntax
base64_encode(data: string): stringAliases
base64encodebase64.encodecrypt.base64.encodecrypt.base64_encodecrypt.base64encodeArguments
| Name | Type | Description |
|---|---|---|
data | string | Lua string bytes passed to Base64 encoder. |
Returns
| Name | Type | Description |
|---|---|---|
encoded | string | Base64 output returned as a Lua string. |
Description
Encodes a Lua string's bytes with Base64 encoder, using = padding and no line breaks.
Call it with 1 parameter(s): data. The argument table explains which values are required and which ones only refine the behavior.
It returns encoded (string). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Encode a Lua string and print the Base64 output.
local encoded = base64_encode("hello world")
print(encoded)
print(base64encode("hello world"))
print(base64.encode("hello world"))