BurntSushi / byteorder

Rust library for reading/writing numbers in big-endian and little-endian.
The Unlicense
981 stars 143 forks source link

Encoding u64 to u48 bytes #118

Closed sharksforarms closed 6 years ago

sharksforarms commented 6 years ago

Is this possible using the API and not having to popthe excess?

I can do

result.write_u64<LittleEndian>(123123);
result.pop();
result.pop();

But it'd be cool if I didn't need to and could just write it out as a u48 (6 bytes)

BurntSushi commented 6 years ago

Why doesn't write_uint solve your problem?

sharksforarms commented 6 years ago

Ahh must have missed that one. Thanks.