16 unstable releases (7 breaking)

✓ Uses Rust 2018 edition

0.8.2 Oct 24, 2019
0.8.0 Jun 13, 2019
0.6.1 Jan 16, 2019
0.5.0 Nov 12, 2018
0.1.0 Dec 29, 2017
Download history 3869/week @ 2019-07-11 3310/week @ 2019-07-18 4247/week @ 2019-07-25 4077/week @ 2019-08-01 4491/week @ 2019-08-08 4366/week @ 2019-08-15 4826/week @ 2019-08-22 6147/week @ 2019-08-29 6588/week @ 2019-09-05 6102/week @ 2019-09-12 5691/week @ 2019-09-19 5137/week @ 2019-09-26 5267/week @ 2019-10-03 4976/week @ 2019-10-10 4975/week @ 2019-10-17

22,183 downloads per month
Used in 101 crates (16 directly)

MIT/Apache

46KB
1K SLoC

Uint

Description

Provides facilities to construct big unsigned integer types. If you want to use a predefined U128, U256 or U512 type, take a look at the primitive-types or ethereum-types crate.

The focus on the provided big unsigned integer types is performance and cross-platform availability. Support a very similar API as the built-in primitive integer types.

Usage

In your Cargo.toml paste

uint = "0.8"

Import the macro

use uint::construct_uint;

If you're using pre-edition Rust in your main file

#[macro_use]
extern crate uint;

Construct your own big unsigned integer type as follows.

// U1024 with 1024 bits consisting of 16 x 64-bit words
construct_uint! {
	pub struct U1024(16);
}

Tests

Basic tests

cargo test --release

Basic tests + property tests

cargo test --release --features=quickcheck

Benchmark tests

cargo bench

Fuzz tests

see fuzz README.md

Crate Features

  • std: Use Rust's standard library.
    • Enables byteorder/std, rustc-hex/std
    • Enabled by default.
  • quickcheck: Enable quickcheck-style property testing
    • Use with cargo test --release --features=quickcheck.

Dependencies

~125–275KB