Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
benches/ | H | 03-May-2022 | - | 836 | 637 | |
src/ | H | 03-May-2022 | - | 8,514 | 6,395 | |
tests/ | H | 03-May-2022 | - | 3,966 | 3,497 | |
.cargo-checksum.json | H A D | 03-May-2022 | 89 | 1 | 1 | |
.cargo_vcs_info.json | H A D | 12-Jun-2020 | 74 | 6 | 5 | |
.gitignore | H A D | 02-Nov-2018 | 30 | 5 | 4 | |
Cargo.toml | H A D | 12-Jun-2020 | 1.8 KiB | 76 | 64 | |
Cargo.toml.orig-cargo | H A D | 12-Jun-2020 | 1.3 KiB | 69 | 54 | |
LICENSE-APACHE | H A D | 02-Nov-2018 | 10.6 KiB | 202 | 169 | |
LICENSE-MIT | H A D | 02-Nov-2018 | 1 KiB | 26 | 22 | |
README.md | H A D | 12-Jun-2020 | 2.3 KiB | 67 | 47 | |
RELEASES.md | H A D | 12-Jun-2020 | 8.6 KiB | 206 | 151 | |
build.rs | H A D | 12-Jun-2020 | 2.2 KiB | 72 | 54 |
README.md
1# num-bigint 2 3[![crate](https://img.shields.io/crates/v/num-bigint.svg)](https://crates.io/crates/num-bigint) 4[![documentation](https://docs.rs/num-bigint/badge.svg)](https://docs.rs/num-bigint) 5[![minimum rustc 1.31](https://img.shields.io/badge/rustc-1.31+-red.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html) 6[![build status](https://github.com/rust-num/num-bigint/workflows/master/badge.svg)](https://github.com/rust-num/num-bigint/actions) 7 8Big integer types for Rust, `BigInt` and `BigUint`. 9 10## Usage 11 12Add this to your `Cargo.toml`: 13 14```toml 15[dependencies] 16num-bigint = "0.3" 17``` 18 19## Features 20 21The `std` crate feature is enabled by default, and is mandatory before Rust 221.36 and the stabilized `alloc` crate. If you depend on `num-bigint` with 23`default-features = false`, you must manually enable the `std` feature yourself 24if your compiler is not new enough. 25 26### Random Generation 27 28`num-bigint` supports the generation of random big integers when the `rand` 29feature is enabled. To enable it include rand as 30 31```toml 32rand = "0.7" 33num-bigint = { version = "0.3", features = ["rand"] } 34``` 35 36Note that you must use the version of `rand` that `num-bigint` is compatible 37with: `0.7`. 38 39## Releases 40 41Release notes are available in [RELEASES.md](RELEASES.md). 42 43## Compatibility 44 45The `num-bigint` crate is tested for rustc 1.31 and greater. 46 47## Alternatives 48 49While `num-bigint` strives for good performance in pure Rust code, other 50crates may offer better performance with different trade-offs. The following 51table offers a brief comparison to a few alternatives. 52 53| Crate | License | Min rustc | Implementation | 54| :--------------- | :------------- | :-------- | :------------- | 55| **`num-bigint`** | MIT/Apache-2.0 | 1.31 | pure rust | 56| [`ramp`] | Apache-2.0 | nightly | rust and inline assembly | 57| [`rug`] | LGPL-3.0+ | 1.37 | bundles [GMP] via [`gmp-mpfr-sys`] | 58| [`rust-gmp`] | MIT | stable? | links to [GMP] | 59| [`apint`] | MIT/Apache-2.0 | 1.26 | pure rust (unfinished) | 60 61[GMP]: https://gmplib.org/ 62[`gmp-mpfr-sys`]: https://crates.io/crates/gmp-mpfr-sys 63[`rug`]: https://crates.io/crates/rug 64[`rust-gmp`]: https://crates.io/crates/rust-gmp 65[`ramp`]: https://crates.io/crates/ramp 66[`apint`]: https://crates.io/crates/apint 67