18 releases

new 0.6.4 May 23, 2019
0.6.2 Feb 13, 2019
0.5.0 Mar 15, 2018
0.2.5 Nov 6, 2017

#21 in Cryptocurrencies

Download history 2727/week @ 2019-02-07 3166/week @ 2019-02-14 3327/week @ 2019-02-21 3094/week @ 2019-02-28 3094/week @ 2019-03-07 2939/week @ 2019-03-14 2932/week @ 2019-03-21 3658/week @ 2019-03-28 3097/week @ 2019-04-04 2973/week @ 2019-04-11 3072/week @ 2019-04-18 2567/week @ 2019-04-25 2500/week @ 2019-05-02 2764/week @ 2019-05-09 3033/week @ 2019-05-16

12,647 downloads per month
Used in 35 crates (3 directly)

MIT license

52KB
1K SLoC

Build Status travis Build Status appveyor

parity-common

Collection of crates used in Parity Technologies projects


lib.rs:

extern crate ethbloom;
#[macro_use] extern crate hex_literal;
use ethbloom::{Bloom, Input};

fn main() {
	use std::str::FromStr;
	let bloom = Bloom::from_str(
		"00000000000000000000000000000000\
         00000000100000000000000000000000\
         00000000000000000000000000000000\
         00000000000000000000000000000000\
         00000000000000000000000000000000\
         00000000000000000000000000000000\
         00000002020000000000000000000000\
         00000000000000000000000800000000\
         10000000000000000000000000000000\
         00000000000000000000001000000000\
         00000000000000000000000000000000\
         00000000000000000000000000000000\
         00000000000000000000000000000000\
         00000000000000000000000000000000\
         00000000000000000000000000000000\
         00000000000000000000000000000000"
    ).unwrap();
	let address = hex!("ef2d6d194084c2de36e0dabfce45d046b37d1106");
	let topic = hex!("02c69be41d0b7e40352fc85be1cd65eb03d40ef8427a0ca4596b1ead9a00e9fc");

	let mut my_bloom = Bloom::default();
	assert!(!my_bloom.contains_input(Input::Raw(&address)));
	assert!(!my_bloom.contains_input(Input::Raw(&topic)));

	my_bloom.accrue(Input::Raw(&address));
	assert!(my_bloom.contains_input(Input::Raw(&address)));
	assert!(!my_bloom.contains_input(Input::Raw(&topic)));

	my_bloom.accrue(Input::Raw(&topic));
	assert!(my_bloom.contains_input(Input::Raw(&address)));
	assert!(my_bloom.contains_input(Input::Raw(&topic)));
	assert_eq!(my_bloom, bloom);
	}

Dependencies

~1MB