zhuangsirui / binpacker Goto Github PK
View Code? Open in Web Editor NEWA binary stream packer and unpacker
License: MIT License
A binary stream packer and unpacker
License: MIT License
I spent all day to find this problem ๐. It was absolutely not obvious.
f1b53c4#commitcomment-24315680
Byte order is only one important option when you need work with binary. There are sense to add it directly to signature.
I propose explicitly add byte order to new functions. It's go way. It should be obvious.
func NewPacker(writer io.Writer, byteOrder binary.ByteOrder) *Packer{}
func NewUnpacker(reader io.Reader, byteOrder binary.ByteOrder) *Unpacker{}
I thought about NewPackerWithOrder but it's not good idea. binpacker single purpose package and it should be concise. SetByteOrder would be unused.
I see there is support for packing uint64.
It will be really great if you could support int64.
May be there is a way to do it already and it is not documented?
I see that you have worked on erlang :) How about implementing something like iolist_to_binary
I believe there is a typo in util.go, I assume you've meant "prefixes" instead of "perfix"?
P.S. Thanks, this is a useful library, helps to avoid writing boilerplate.
Hi!
It was as 5 months when you proposed to use the semantic versioning.
#8 (comment)
We Sturfeeinc use your binpacker in critical part of our system. I had big problems at previous time when I didn't use dependency management tools (#8). Now we have to be more responsible because we launch API soon.
Could you please to add version tags?
Recently I added versions tags to my library UTM.
I propose 08a1b29 as v1.0.0
git checkout 08a1b29 .
Please change a message if you don't like it.
git tag -a v1.0.0 -m "Library was used in production for long time. We found one serious error. It considered stable now."
git push origin refs/tags/v1.0.0
Hi
is there a way with the unpacker to read last byte ?
or fetch just last byte
Hello,
The following functions have typos in them. They should end in Prefix, not Perfix
StringWithUint16Perfix
StringWithUint32Perfix
StringWithUint64Perfix
BytesWithUint16Perfix
BytesWithUint32Perfix
BytesWithUint64Perfix
Does the project support arbitrary width bits? For example, type of 13 bits and etc.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.