I have made an extremely good table serializer. A table serializer is code that turns a table into a string.
Advantages over JSON
- About four times as small as JSON
- Much more reliable
- Relatively fast
Usage
The module contains four functions
- .encode | Serializes a table
- .decode | Deserializes a table
- .encode64 | Serializes a table and returns the result in Base 64
- .decode64 | Deserializes a table encoded in Base 64
Example
local vs = require(12143638565)
local data = {money = 55, stage = 15, rebith = 2} --sample data
local encoded = vs.encode64(data)
print(encoded) --result should be 1XVXn0dlqYOtpYQ8UDdjE4Wsp7Ubw7fia8adtQ0MDg000
Use Cases
The main use cases for this would be
- Sending data over events
- Saving data to data stores (note: make sure to use 64 varients of the functions for this)
- Sending lots of data using the MessagingService.
Limitations
- Does not encode Roblox Data Types (Instances, Color3, ect)
- Does not encode functions, userdatas, threads
- Does not encode metatables
- Cannot handle cycle references.
That is about it, hope someone can find this useful.