Encode and decode netstrings.
luarocks install ers35/netstring
Encode a netstring.
local encoded = netstring.encode("hello")
Decode a netstring.
local decoded, remainder = netstring.decode("5:hello,5:world,")
Returns an iterator function that, each time it is called, returns the next decoded
string from encoded
.
local encoded = "5:hello,5:world,"
for decoded in netstring.gdecode(encoded) do
print(decoded)
end