base64decode Synchronous
base64.decodebase64_decodecrypt.base64.decodecrypt.base64_decodecrypt.base64decodesyn.crypt.base64.decodesyn.crypto.base64.decode
Recover the original byte string from a standard Base64 value. This is useful after reading binary content from a JSON document or receiving it through a text-only endpoint.
Luau
base64decode(data: string) -> stringParameters
| Parameter | Type | Description |
|---|---|---|
data | string | Base64 text using the standard + and / alphabet and required = padding. |
Returns
stringThe decoded bytes as a Luau string, including any embedded zero bytes.
Usage notes
Malformed input raises an error. This decoder rejects whitespace, URL-safe substitutions, and missing required padding; use pcall for data you do not control.
Example
Luau
local ok, bytes = pcall(base64decode, "aGVsbG8=")
if ok then
print(bytes) -- hello
end