liteserver / binn

Binary Serialization

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blob size implementation always uses 4-byte block

opened this issue · comments

Hello,

In specification, blob size can be 1 or 4-byte block. However, as far as I understand your code, blob size always uses 4-byte block. (I know very basic C).

If that is true, I think your implementation should be updated, to support 1-byte block.

May I ask if you could check?

Thank you,

Indeed, you are right. It is differing from the documentation.

I could fix it but it can cause a problem for some users. The updated version will be able to read binns created by the previous versions but the previous versions will not be able to read a blob created by the updated code (for blobs > 127 bytes).

I guess I will update it in a separate branch.

Thank you, I understand your concern.

I think it's better if the implementation follows specification. It might help if you use semantic versioning (https://semver.org), and your users can decide which version they should use.

It also helps, when implementations in other languages produce 1-byte sizes for blobs. In such cases, current C code can't handle it :-(

Thanks again for your hard work.

OK, I fixed the problem and I added tags to the code.

It is the first time I did it so there were no messages. Next time I will add comments.

Thank you for your suggestions!

Thank you very much, it is working :-)