Skip to content

Base64

Base64 encoding and decoding functions are available both globally and under the crypt.base64 namespace.


encode

function crypt.base64.encode(data: string): string
function base64_encode(data: string): string

Encodes data to Base64.

Example

local encoded = crypt.base64.encode("Hello World")
-- Or globally
local encoded = base64_encode("Hello World")

decode

function crypt.base64.decode(data: string): string
function base64_decode(data: string): string

Decodes Base64 encoded data.

Example

local decoded = crypt.base64.decode(encoded)
-- Or globally
local decoded = base64_decode(encoded)