Skip to main content

string

This namespace may be called like a function to return a string serdes, or it may be accessed like a table to use the string content.

Properties​

binary​

string.binary: string

The alphabet '01'.

octal​

string.octal: string

The alphabet '01234567'.

decimal​

string.decimal: string

The alphabet '0123456789'.

duodecimal​

string.duodecimal: string

The alphabet '0123456789AB'.

hexadecimal​

string.hexadecimal: string

The alphabet '0123456789ABCDEF'.

utf8​

string.utf8: string

The alphabet of all 256 possible characters.

lower​

string.lower: string

The alphabet 'abcdefghijklmnopqrstuvwxyz'.

upper​

string.upper: string

The alphabet 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.

letters​

string.letters: string

The alphabet lower .. upper.

punctuation​

string.punctuation: string

The alphabet ' .,?!:;\'"-_'.

english​

string.english: string

The alphabet letters .. punctuation.

filepath​

string.filepath: string

The alphabet letters .. ':/'.

datastore​

string.datastore: string

The alphabet of every character that doesn't get expanded when JSON encoding.

Functions​

packintoalphanumeric​

string.packintoalphanumeric(str: string) → buffer

Packs the string into 6 bits per character, reducing length by average of 25%. Only supports uppercase & lowercase letters and numbers. Unsupported characters are replaced by spaces.

unpackalphanumeric​

string.unpackalphanumeric(buf: buffer) → string

Converts back the buffer into a string. Remainder bytes at the end of the text are replaced by spaces.

convert​

string.convert(
str: string,
inAlphabet: string,
outAlphabet: string
) → string

Converts a string, treated as a number in base inAlphabet, to a number in base toAlphabet.

alphabet​

string.alphabet(source: string) → string

Returns the smallest sorted alphabet from a source string.

Show raw api
{
    "functions": [
        {
            "name": "packintoalphanumeric",
            "desc": "Packs the string into 6 bits per character, reducing length by average of 25%.\nOnly supports uppercase & lowercase letters and numbers. Unsupported characters are replaced by spaces.",
            "params": [
                {
                    "name": "str",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "buffer"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 428,
                "path": "docs_luau/moonwave.luau"
            }
        },
        {
            "name": "unpackalphanumeric",
            "desc": "Converts back the buffer into a string. Remainder bytes at the end of the text are replaced by spaces.",
            "params": [
                {
                    "name": "buf",
                    "desc": "",
                    "lua_type": "buffer"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 436,
                "path": "docs_luau/moonwave.luau"
            }
        },
        {
            "name": "convert",
            "desc": "Converts a string, treated as a number in base `inAlphabet`, to a number in base `toAlphabet`.",
            "params": [
                {
                    "name": "str",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "inAlphabet",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "outAlphabet",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 446,
                "path": "docs_luau/moonwave.luau"
            }
        },
        {
            "name": "alphabet",
            "desc": "Returns the smallest sorted alphabet from a source string.",
            "params": [
                {
                    "name": "source",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 454,
                "path": "docs_luau/moonwave.luau"
            }
        }
    ],
    "properties": [
        {
            "name": "binary",
            "desc": "The alphabet `'01'`.",
            "lua_type": "string",
            "source": {
                "line": 458,
                "path": "docs_luau/moonwave.luau"
            }
        },
        {
            "name": "octal",
            "desc": "The alphabet `'01234567'`.",
            "lua_type": "string",
            "source": {
                "line": 462,
                "path": "docs_luau/moonwave.luau"
            }
        },
        {
            "name": "decimal",
            "desc": "The alphabet `'0123456789'`.",
            "lua_type": "string",
            "source": {
                "line": 466,
                "path": "docs_luau/moonwave.luau"
            }
        },
        {
            "name": "duodecimal",
            "desc": "The alphabet `'0123456789AB'`.",
            "lua_type": "string",
            "source": {
                "line": 470,
                "path": "docs_luau/moonwave.luau"
            }
        },
        {
            "name": "hexadecimal",
            "desc": "The alphabet `'0123456789ABCDEF'`.",
            "lua_type": "string",
            "source": {
                "line": 474,
                "path": "docs_luau/moonwave.luau"
            }
        },
        {
            "name": "utf8",
            "desc": "The alphabet of all 256 possible characters.",
            "lua_type": "string",
            "source": {
                "line": 478,
                "path": "docs_luau/moonwave.luau"
            }
        },
        {
            "name": "lower",
            "desc": "The alphabet `'abcdefghijklmnopqrstuvwxyz'`.",
            "lua_type": "string",
            "source": {
                "line": 482,
                "path": "docs_luau/moonwave.luau"
            }
        },
        {
            "name": "upper",
            "desc": "The alphabet `'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`.",
            "lua_type": "string",
            "source": {
                "line": 486,
                "path": "docs_luau/moonwave.luau"
            }
        },
        {
            "name": "letters",
            "desc": "The alphabet `lower .. upper`.",
            "lua_type": "string",
            "source": {
                "line": 490,
                "path": "docs_luau/moonwave.luau"
            }
        },
        {
            "name": "punctuation",
            "desc": "The alphabet `' .,?!:;\\'\"-_'`.",
            "lua_type": "string",
            "source": {
                "line": 494,
                "path": "docs_luau/moonwave.luau"
            }
        },
        {
            "name": "english",
            "desc": "The alphabet `letters .. punctuation`.",
            "lua_type": "string",
            "source": {
                "line": 498,
                "path": "docs_luau/moonwave.luau"
            }
        },
        {
            "name": "filepath",
            "desc": "The alphabet `letters .. ':/'`.",
            "lua_type": "string",
            "source": {
                "line": 502,
                "path": "docs_luau/moonwave.luau"
            }
        },
        {
            "name": "datastore",
            "desc": "The alphabet of every character that doesn't get expanded when JSON encoding.",
            "lua_type": "string",
            "source": {
                "line": 506,
                "path": "docs_luau/moonwave.luau"
            }
        }
    ],
    "types": [],
    "name": "string",
    "desc": "This namespace may be called like a function to return a string serdes, or it may be accessed like a table to use the string content.",
    "source": {
        "line": 419,
        "path": "docs_luau/moonwave.luau"
    }
}