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(strstring) → buffer

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

unpackalphanumeric

string.unpackalphanumeric(bufbuffer) → string

Converts back the buffer into a string.

convert

string.convert(
strstring,
inAlphabetstring,
outAlphabetstring
) → string

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

alphabet

string.alphabet(sourcestring) → 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.",
            "params": [
                {
                    "name": "str",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "buffer"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 105,
                "path": "src/moonwave.luau"
            }
        },
        {
            "name": "unpackalphanumeric",
            "desc": "Converts back the buffer into a string.",
            "params": [
                {
                    "name": "buf",
                    "desc": "",
                    "lua_type": "buffer"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 113,
                "path": "src/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": 123,
                "path": "src/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": 131,
                "path": "src/moonwave.luau"
            }
        }
    ],
    "properties": [
        {
            "name": "binary",
            "desc": "The alphabet `'01'`.",
            "lua_type": "string",
            "source": {
                "line": 135,
                "path": "src/moonwave.luau"
            }
        },
        {
            "name": "octal",
            "desc": "The alphabet `'01234567'`.",
            "lua_type": "string",
            "source": {
                "line": 139,
                "path": "src/moonwave.luau"
            }
        },
        {
            "name": "decimal",
            "desc": "The alphabet `'0123456789'`.",
            "lua_type": "string",
            "source": {
                "line": 143,
                "path": "src/moonwave.luau"
            }
        },
        {
            "name": "duodecimal",
            "desc": "The alphabet `'0123456789AB'`.",
            "lua_type": "string",
            "source": {
                "line": 147,
                "path": "src/moonwave.luau"
            }
        },
        {
            "name": "hexadecimal",
            "desc": "The alphabet `'0123456789ABCDEF'`.",
            "lua_type": "string",
            "source": {
                "line": 151,
                "path": "src/moonwave.luau"
            }
        },
        {
            "name": "utf8",
            "desc": "The alphabet of all 256 possible characters.",
            "lua_type": "string",
            "source": {
                "line": 155,
                "path": "src/moonwave.luau"
            }
        },
        {
            "name": "lower",
            "desc": "The alphabet `'abcdefghijklmnopqrstuvwxyz'`.",
            "lua_type": "string",
            "source": {
                "line": 159,
                "path": "src/moonwave.luau"
            }
        },
        {
            "name": "upper",
            "desc": "The alphabet `'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`.",
            "lua_type": "string",
            "source": {
                "line": 163,
                "path": "src/moonwave.luau"
            }
        },
        {
            "name": "letters",
            "desc": "The alphabet `lower .. upper`.",
            "lua_type": "string",
            "source": {
                "line": 167,
                "path": "src/moonwave.luau"
            }
        },
        {
            "name": "punctuation",
            "desc": "The alphabet `' .,?!:;\\'\"-_'`.",
            "lua_type": "string",
            "source": {
                "line": 171,
                "path": "src/moonwave.luau"
            }
        },
        {
            "name": "english",
            "desc": "The alphabet `letters .. punctuation`.",
            "lua_type": "string",
            "source": {
                "line": 175,
                "path": "src/moonwave.luau"
            }
        },
        {
            "name": "filepath",
            "desc": "The alphabet `letters .. ':/'`.",
            "lua_type": "string",
            "source": {
                "line": 179,
                "path": "src/moonwave.luau"
            }
        },
        {
            "name": "datastore",
            "desc": "The alphabet of every character that doesn't get expanded when JSON encoding.",
            "lua_type": "string",
            "source": {
                "line": 183,
                "path": "src/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": 96,
        "path": "src/moonwave.luau"
    }
}