17 unstable releases (6 breaking)

0.7.0 Aug 12, 2019
0.6.4 May 23, 2019
0.6.2 Feb 13, 2019
0.5.0 Mar 15, 2018
0.2.5 Nov 6, 2017
Download history 2136/week @ 2019-04-29 2572/week @ 2019-05-06 3148/week @ 2019-05-13 2596/week @ 2019-05-20 3135/week @ 2019-05-27 2843/week @ 2019-06-03 3133/week @ 2019-06-10 1955/week @ 2019-06-17 1933/week @ 2019-06-24 1830/week @ 2019-07-01 2370/week @ 2019-07-08 2492/week @ 2019-07-15 2514/week @ 2019-07-22 2628/week @ 2019-07-29 2562/week @ 2019-08-05

10,860 downloads per month
Used in 44 crates (3 directly)

MIT license

51KB
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

~787KB