Skip to content

Search

Documentation

encoding

Bytes to base64 text and back, and UTF-8 bytes back to text. The encoding script module of the Balaur game engine: 3 functions and 0 constants a script…

On this page

Bytes to base64 text and back, and UTF-8 bytes back to text.

3 functions, 0 constants. Scripts reach it as encoding::.

Functions

Argument kinds are the script values a call passes: node is a node handle, any a table or value of any kind, fn a callback.

function acts on what it does
base64([int]) -> string — Bytes as standard base64 with padding; a value outside 0 to 255 traps.
from_base64(string) -> [int] — The bytes a base64 string encodes, in the standard alphabet with its padding; text that is not base64 traps.
from_utf8([int]) -> str? — The text UTF-8 bytes spell; nil when they are not UTF-8, a value outside 0 to 255 included.

Are you sure?