Go to file
Wei Tang 1564dc1f63 Remove serialize crate (replaced by serde) and use impl-serde in ethbloom 2018-12-02 22:34:58 +08:00
benches Fix warnings 2017-08-22 15:18:33 +02:00
ethbloom Remove serialize crate (replaced by serde) and use impl-serde in ethbloom 2018-12-02 22:34:58 +08:00
ethereum-types Improve some formatting of #[cfg(..)] 2018-11-13 11:27:50 +01:00
no-std-tests [no-std-tests] Add `fixed-hash/byteorder` used feature 2018-11-30 17:58:36 +01: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 Add `no-std-tests` to the workspace 2018-09-02 20:52:46 +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 More accurate description of the repo 2018-09-02 20:46:51 +02:00

README.md

Ethereum primitives

Build Status

Fixed-sized integer arithmetic (ethereum-types) and bloom filter (ethbloom)

To add this crate to your project, add the following in Cargo.toml

[dependencies]
ethereum-types = "0.4"
ethbloom = "0.5"

A basic example how to use this crate:

extern crate ethereum_types;
extern crate ethbloom;

use ethereum_types::U256;
use ethbloom::{Bloom, Input};

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

	let address = [0_u8; 32];
	let mut my_bloom = Bloom::default();
	assert!(!my_bloom.contains_input(Input::Raw(&address)));
	my_bloom.accrue(Input::Raw(&address));
}

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.4", default-features = false }
ethbloom = { version = "0.5", default-features = false }