bigeasy / packet

Incremental binary parsers and serializers for Node.js.

Home Page:http://bigeasy.github.io/packet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need to transform for `sizeOf`.

bigeasy opened this issue · comments

The sizeOf function are not doing a conversion. Try this one with the sync serializer.

exports.packet = {
    object: {
        value: 32,
        string: [[
            ($_) => Buffer.from($_, 'utf8')
        ], [ 16, [ Buffer ] ], [
            ($_) => $_.toString('utf8')
        ]]
    }
}