Skip to content

ers35/netstring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

netstring

Encode and decode netstrings.

Install

luarocks install ers35/netstring

Usage

netstring.encode(decoded)

Encode a netstring.

local encoded = netstring.encode("hello")

netstring.decode(encoded)

Decode a netstring.

local decoded, remainder = netstring.decode("5:hello,5:world,")

netstring.gdecode(encoded)

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

About

Encode and decode netstrings.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published