The bin library provides function for packing and unpacking binary data. It can be imported into a script as follows:
local bin = require("pktizr.bin")
The provided functions can then be used by prepending bin. to the name (e.g. bin.pack(...)).
Returns a binary string containing the values v1, v2, etc. packed (that is, serialized in binary form) according to the format string fmt.
Returns the values packed in the string s according to the format string fmt. An optional pos marks where to start reading in s (default is 1). After the read values, this function also returns the index of the first unread byte in s.