Ethereum Bloom Filter
Go to file
Jacek Sieka 3721d797d4
Update README.md
2019-03-25 19:07:42 -06:00
src Use stint instead of ttmath 2018-05-08 17:47:56 +03:00
tests Use stint instead of ttmath 2018-05-08 17:47:56 +03:00
.appveyor.yml appveyor: fix version check 2018-09-06 12:00:55 -06:00
.gitignore Initial commit 2018-03-02 19:08:36 +02:00
.travis.yml readme: fix license, badges 2018-09-04 22:08:52 -06:00
LICENSE-APACHEv2 Updated license 2018-03-02 23:47:40 +02:00
LICENSE-MIT Updated license 2018-03-02 23:47:40 +02:00
README.md Update README.md 2019-03-25 19:07:42 -06:00
eth_bloom.nimble add "--threads:on" to tests 2019-01-08 23:41:27 +01:00

README.md

eth_bloom: an Ethereum Bloom Filter

MOVED TO https://github.com/status-im/nim-eth

Build Status (Travis) Windows build status (Appveyor) License: Apache License: MIT Stability: experimental

Introduction

A Nim implementation of the bloom filter used by Ethereum.

Description

Bloom filters are data structures that use hash functions to test whether an element is a member of a set. They work like other data structures but are probabilistic in nature: that is, they allow false positive matches but not false negative. Bloom filters use less storage space than other data structures.

Ethereum bloom filters are implemented with the Keccak-256 cryptographic hash function.

To see the bloom filter used in the context of Ethereum, please refer to the Ethereum Yellow Paper.

Installation

$ nimble install eth_bloom

Usage

import eth_bloom, stint
var f: BloomFilter
f.incl("test1")
assert("test1" in f)
assert("test2" notin f)
f.incl("test2")
assert("test2" in f)
assert(f.value.toHex == "80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000200000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000")

License

Licensed and distributed under either of

or

at your option. This file may not be copied, modified, or distributed except according to those terms.