Go to file
Niklas Adofsson 0d1133ef75 Use `rustc-hex v2.0` with explicit types
The issue was that the trait `FromHex` has changed and is now using
`FromIterator<u8>` instead of `FromIterator<Vec<u8>>` and was `inferred`
to `[u8]` instead of `Vec<u8>`. Thus, has not compile-time size and
won't work!

Well, this could be improved to be stack allocated because
we know the `size` of the hexstring but in this case I think
is sufficient and only used in tests!
2018-08-23 12:03:11 +02:00
benches Fix warnings 2017-08-22 15:18:33 +02:00
ethbloom Use `rustc-hex v2.0` with explicit types 2018-08-23 12:03:11 +02:00
ethereum-types remove version 2018-08-22 16:56:10 +02:00
no-std-tests Add `rust-toolchain` file 2018-07-05 17:46:33 +02:00
serialize nits (#39) 2018-07-05 11:33:55 +02:00
.editorconfig Fix indentation. 2018-01-28 17:48:23 +01:00
.gitignore mul and from optimizations 2017-08-17 17:25:00 +02:00
.travis.yml Fix travis 2018-07-13 19:11:49 +02:00
Cargo.toml Merge branch 'master' into chore/remove-fixed-hash 2018-08-03 16:37:30 +02:00
LICENSE-APACHE relicense under mit/apache2 2017-05-11 15:25:52 +02:00
LICENSE-MIT relicense under mit/apache2 2017-05-11 15:25:52 +02:00
README.md Update README.md 2018-03-15 10:36:41 +01:00

README.md

bigint

Build Status

Fixed-sized integers arithmetic

To specify a dependency, add to Cargo.toml

[dependencies]
ethereum-types = "0.3"

Little example

extern crate ethereum_types;
use ethereum_types::U256;

fn main() {
	let mut val: U256 = 1023.into();
	for _ in 0..200 { val = val * 2u32 }
	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]
ethereum-types = { version = "0.3", default-features = false }