base64encode Synchronous

  • base64.encode
  • base64_encode
  • crypt.base64.encode
  • crypt.base64_encode
  • crypt.base64encode
  • syn.crypt.base64.encode
  • syn.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.

Syntax
Luau
base64encode(data: string) -> string

Parameters

Function parameters
ParameterTypeDescription
datastringOriginal bytes to encode. Zero bytes are preserved.

Returns

string

Base64 text using the standard alphabet and padding. Base64 changes the representation of data; it does not encrypt it.

Example

Example
Luau
local text = base64encode("hello")
print(text) -- aGVsbG8=
print(base64decode(text)) -- hello
Kawaii documentation