Announcing a new big integer crate `bnum`, which uses const generics to allow fixed precision integers of arbitrary size to be stored on the stack. Optional features enable generating random big integers, `serde` compatibility, and making nearly every method `const`.
I have just finished making my first library in Rust, bnum. It provides both signed (BInt) and unsigned (BUint) integer types of arbitrary size that aim to adhere to the behaviour of Rust's built in integer types, e.g. u32. Using the recent const generics feature, the integers can be stored as an array on the stack, meaning that no heap allocations are made when creating or performing operations on an integer. Additionally, the crate can be used in no_std environments.
I have replicated the behaviour of nearly every method defined on Rust's primitive integer types as well as providing a few other helpful methods that are not defined on the primitives. The crate can be compiled with the stable Rust compiler, but there is a nightly feature which can be enabled, which allows nearly all methods and trait implementations to be const as well as enabling a few other methods. As the name suggests though, this feature can only be used with nightly Rust.
Other features can be enabled to allow serialisation and deserialisation via the serde crate and generation of random integers via the rand crate. In addition, the numtraits feature provides implementations of many traits exported from the num crate.
Feedback on this here or on GitHub is welcome! Thanks!