16 stable releases (3 major)

Uses old Rust 2015

4.4.3 May 7, 2020
4.4.1 Aug 20, 2018
4.4.0 Jun 11, 2018
4.2.0 Sep 6, 2017
1.0.1 Dec 26, 2016

⚠️ Issues reported

#8 in #u256

Download history 1597/week @ 2023-12-08 1367/week @ 2023-12-15 912/week @ 2023-12-22 772/week @ 2023-12-29 1417/week @ 2024-01-05 1181/week @ 2024-01-12 1192/week @ 2024-01-19 1178/week @ 2024-01-26 911/week @ 2024-02-02 1119/week @ 2024-02-09 1456/week @ 2024-02-16 1249/week @ 2024-02-23 1317/week @ 2024-03-01 1713/week @ 2024-03-08 1230/week @ 2024-03-15 1311/week @ 2024-03-22

5,796 downloads per month
Used in 73 crates (30 directly)

MIT/Apache

72KB
2K SLoC

bigint

Build Status

API Documentation

DEPRECATED

This crate is deprecated and will not be developed further. Users are invited to prefer the uint crate instead.

Old readme:

Fixed-sized integers arithmetic

To specify a dependency, add to Cargo.toml

[dependencies]
bigint = "4"

Little example

extern crate bigint;
use bigint::U256;

fn main() {
	let mut val: U256 = 1023.into();
	for _ in 0..200 { val = val * 2.into() }
	assert_eq!(
		&format!("{}", val),
		"1643897619276947051879427220465009342380213662639797070513307648"
	);
}

no_std crates

This crate has a feature, std, that is enabled by default. To use this crate in a no_std context, add the following to your Cargo.toml:

[dependencies]
bigint = { version = "4", default-features = false }

License

bigint is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), at your choice.

See LICENSE-APACHE, and LICENSE-MIT for details.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in bigint by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~98–480KB