Crates.io | uint-crate |
lib.rs | uint-crate |
version | 0.9.1 |
source | src |
created_at | 2021-02-18 12:50:21.124779 |
updated_at | 2021-06-08 02:03:09.802498 |
description | Tetsy Common Large Fixed-Size Integer Arithmetic |
homepage | http://tetcoin.org |
repository | https://github.com/tetcoin/tetsy-common |
max_upload_size | |
id | 357018 |
size | 133,233 |
Provides facilities to construct big unsigned integer types which use no allocations (stack-based, fixed bit length).
If you want to use a predefined U128
, U256
or U512
type, take a look at the tetsy-primitive-types
or vapory-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.
In your Cargo.toml
paste
uint = "0.9.0"
Import the macro
use uint_crate::construct_uint;
If you're using pre-edition Rust in your main file
#[macro_use]
extern crate uint_crate;
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);
}
cargo test --release
cargo test --release --features=quickcheck
cargo bench
see fuzz README.md
std
: Use Rust's standard library.
byteorder/std
, rustc-hex/std
quickcheck
: Enable quickcheck-style property testing
cargo test --release --features=quickcheck
.arbitrary
: Allow for creation of an uint
object from random unstructured input for use with fuzzers that use the arbitrary
crate.