Currently, there is an API pkt:decode(Data) to decode binary to various records provided by pkt library. It would be good to have an API for pkt:encode(Data) as well to convert records in pkt to binary data. This way, a caller can fill the required records and have the list encoded to a binary as a single API. Also, the encode function would give symmetricity to the APIs you have provided.
Currently, there is an API
pkt:decode(Data)
to decode binary to various records provided bypkt
library. It would be good to have an API forpkt:encode(Data)
as well to convert records inpkt
to binary data. This way, a caller can fill the required records and have the list encoded to a binary as a single API. Also, the encode function would give symmetricity to the APIs you have provided.