module
base64
Functions
M.encode
Encode binary `data` into a Base64 ASCII string. Trailing partial groups are padded with `=` so the output length is always a multiple of 4. NUL bytes inside `data` are handled correctly.
M.encode(data)
datastringRaw byte sequence (Lua string).
→ stringBase64-encoded ASCII (only [A-Za-z0-9+/=]).
M.decode
Decode a Base64 ASCII `src` string back to bytes. Whitespace inside the input is silently ignored (matches RFC 4648 common practice). Invalid characters or malformed padding return `nil` rather than raising, mirroring the bridge's `-1` sentinel.
M.decode(src)
srcstringBase64-encoded input.
→ string|nilDecoded bytes, or `nil` on parse error.