parity-common/uint
Benjamin Wasty 42ca5e0e9c add uint operator benchmarks (#82) 2019-01-26 20:16:52 +01:00
..
benches add uint operator benchmarks (#82) 2019-01-26 20:16:52 +01:00
examples Allow private uint definition and crunchy convenience fix 2018-12-03 12:56:37 +08:00
src Fix for the review. 2019-01-14 11:03:45 +01:00
tests Add some tests. 2019-01-11 14:29:51 +01:00
Cargo.toml Bump primitive-types and uint version 2019-01-15 17:43:35 +01:00
README.md fix(grumble): "0.6.1" -> "0.6" 2019-01-16 13:04:13 +01:00

README.md

Uint

Description

Provides facilities to construct big unsigned integer types. Also provides commonly used U128, U256 and U512 out of the box.

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.6"

Construct your own big unsigned integer type as follows.

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

Tests

Basic tests

cargo test --release

Basic tests + property tests

cargo test --release --features=quickcheck

Benchmark tests

cargo bench

Crate Features

  • std: Use Rust's standard library.
    • Enables byteorder/std, rustc-hex/std
    • Enabled by default.
  • common: Provide commonly used U128, U256 and U512 big unsigned integer types.
    • Enabled by default.
  • quickcheck: Enable quickcheck-style property testing
    • Use with cargo test --release --features=quickcheck.
  • heapsize: Implement base trait of the heapsizeof crate
    • Use with cargo build --feature=heapsize.