[][src]Crate smallbigint

A wrapper around num_bigint::BigUint and num_bigint::BigInt that stays out of the heap for small values.

In the current implementation, we go to the heap for anything that doesn't fit in 32 bits.

This crate already has a lot of relevant methods, but it is not really complete yet. Patches are welcome!

Care has usually been taken to avoid allocation in the methods here, but not in all cases.

To do, and important:

  • Implement std::fmt::{Binary, LowerHex, Octal, UpperHex} (easy?)
  • Implement num_bigint::{ToBigInt, ToBigUint}

Other traits and methods still to be implemented:

Not done and seems hard:

There aren't super many unit tests currently, but the code is sufficiently simple that there is not much space where bugs could hide.

Structs

Int
IntIsNegativeError
Uint