-
Notifications
You must be signed in to change notification settings - Fork 188
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
Expose BigDigit
and IntDigits
#152
Comments
Ah I just see you comment on a different issue about exposing
That's a really good point. I am actually targeting different platforms. So now I'm wondering: if I encode a Maybe there's another way around my initial problem, since exposing Maybe // returns how many bytes were written
fn write_le(&self, buf: &mut [u8]) -> Result<usize> {
// ...
} |
The byte representation should be independent of whatever digit size was used internally. Why do you suspect there could be a problem here?
Maybe you could use the serde support here with bincode? I think you could then serialize your whole vector in one shot, maybe even as part of some surrounding data too. Otherwise, another suggestion in #12 was to add iterators. I think a |
I currently have to use a fork of bigint that just expose the internal slice. Iterator support would be awesome. I guess something like: fn iter_bytes_le() -> impl Iterator<Item = u8>; // (+ ExactSize + DoubleEnded + Fused)
fn iter_bytes_be() -> impl Iterator<Item = u8>;
fn iter_u32_digits() -> impl Iterator<Item = u32>;
fn iter_u64_digits() -> impl Iterator<Item = u64>; |
Hello,
I'll like to implement some sort of custom version of
biguint::to_bitwise_digits_le
that take a&mut [u8]
instead of allocating aVec
. For this I'd need access to theBigDigit
s, but it's not exposed. Would it be possible to make this type and theIntDigit
trait public?If this is something you would consider I can make a PR to document
IntDigit
, since it's currently undocumented.The text was updated successfully, but these errors were encountered: