Module system.utils.serial.LJBuffer

Functions

determinize (str) Post-processes a serialized LuaJIT buffer string to yield an equivalent deterministic string.
safeEncode (value) Checks if the specified value is safely encodable by LJBuffer, and encodes it if possible.


Functions

determinize (str)
Post-processes a serialized LuaJIT buffer string to yield an equivalent deterministic string.

Parameters:

  • str string The serialized data to be determinized

Returns:

    string str Deterministic and unique string representing the same object
safeEncode (value)
Checks if the specified value is safely encodable by LJBuffer, and encodes it if possible.

Distinguishes between unsafe encodable values (metatables, but no invalid types) by returning nil, and unencodable values (invalid types, cycles) by returning false.

Parameters:

  • value table|number|boolean|string|nil The value to be encoded

Returns:

  1. boolean? encodable true if safely encodable, false on encoding errors, nil on metatables
  2. string? str Value encoded as a string, or nil if encoding failed
generated by LDoc 1.4.6