love.data.pack
Packs (serializes) simple Lua values.

This function behaves the same as Lua 5.3's string.pack.
data = love.data.pack( container, format, v1, ... )
container ContainerType What type to return the encoded data as.
format string A string determining how the values are packed. Follows the rules of Lua 5.3's string.pack format strings.
v1 number or boolean or string The first value (number, boolean, or string) to serialize.
... number or boolean or string Additional values to serialize.
data Data or string Data/string which contains the serialized data.