This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
KillaVanilla's profile picture

[API] Serializer API

Started by KillaVanilla, 02 September 2012 - 11:47 PM
KillaVanilla #1
Posted 03 September 2012 - 01:47 AM
EDIT:

Please do not reply to this. It is stupid and useless, and I have no idea why I ever decided to make this.

I've made a simple API that serializes and deserializes strings, numbers, and tables for transmission over rednet. It can be found on pastebin:

BWR4K032

Documentation:

serializer.serialize(input1, input2, …) - Returns a string.
This serializes all of its arguments into one string, with each argument separated by a colon (":").
This expects all of its arguments to be either strings, numbers, or tables.
Tables are themselves serialized with textutils.serialize() before being added to the output.

serializer.deserialize(serialized) - Returns a table.
This deserializes a group of variables that have been serialized by the serialize() function.
dimitriye98 #2
Posted 09 September 2012 - 09:16 PM
So, basically a reimplementation of textutils.serialize and textutils.unserialize?
CastleMan2000 #3
Posted 25 September 2012 - 04:02 PM
I think that only works for tables… Doesn't it?