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 returningfalse
.Parameters:
- value table|number|boolean|string|nil The value to be encoded
Returns:
- boolean? encodable true if safely encodable, false on encoding errors, nil on metatables
- string? str Value encoded as a string, or nil if encoding failed