-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature request] Convert from/to bytes #6
Comments
This shouldn't be too hard to add for MSB-encoding, since that's what the lower-level base conversion functions do already. For LSB-encoded, on a little-endian system I should be able to just copy the bytes directly into a new |
Just realized that I'm missing some information for this feature. |
I'm only planning on converting positive numbers. IMO, it's better to just encode the magnitude and let the user handle the sign. Personally, I'd prefer MSB (I'm sending the numbers over the network) but it would be nice to support both. |
It would be really nice if there were a way to convert Ints from/to byte slices (i.e. MSB/LSB encoded integers). Currently, I'm just doing a bunch of shifts and adds but this is definitely not the best way to do this.
The text was updated successfully, but these errors were encountered: