base64encode Synchronous
base64.encodebase64_encodecrypt.base64.encodecrypt.base64_encodecrypt.base64encodesyn.crypt.base64.encodesyn.crypto.base64.encode
Represent a string’s bytes as Base64 text so binary data can be stored or transferred through text-based formats. Use it when JSON or another text channel must carry bytes. Base64 increases the representation size and provides neither compression nor encryption.
Luau
base64encode(data: string) -> stringParameters
| Parameter | Type | Description |
|---|---|---|
data | string | Original bytes to encode. Zero bytes are preserved. |
Returns
stringBase64 text using the standard alphabet and padding. Base64 changes the representation of data; it does not encrypt it.
Example
Luau
local text = base64encode("hello")
print(text) -- aGVsbG8=
print(base64decode(text)) -- hello