Skip to content
Encoding & cryptographyReference

crypt.base64encode

Encode a binary string as Base64 text.

Aliasesbase64encodebase64_encodebase64.encodecrypt.base64_encodecrypt.base64.encode

Details#

Encode a binary string as Base64 text. Base64 text with standard alphabet and padding.

Signature#

Luau
crypt.base64encode(data: string): string

Parameters#

ParameterTypeDescription
datastringBytes to encode; embedded NUL bytes are supported.

Returns#

Base64 text with standard alphabet and padding.

Examples#

Local example

Luau
print(crypt.base64encode("hello")) -- aGVsbG8=