merkle alternatives and similar packages
Based on the "Data Structures" category.
Alternatively, view merkle alternatives based on common mentions on social networks and blogs.
-
gods
GoDS (Go Data Structures) - Sets, Lists, Stacks, Maps, Trees, Queues, and much more -
go-datastructures
A collection of useful, performant, and threadsafe Go datastructures. -
golang-set
A simple, battle-tested and generic set type for the Go language. Trusted by Docker, 1Password, Ethereum and Hashicorp. -
willf/bloom
Go package implementing Bloom filters, used by Milvus and Beego. -
gocache
☔️ A complete Go cache library that brings you multiple ways of managing your caches -
boomfilters
Probabilistic data structures for processing continuous, unbounded streams. -
gostl
Data structure and algorithm library for go, designed to provide functions similar to C++ STL -
hyperloglog
HyperLogLog with lots of sugar (Sparse, LogLog-Beta bias correction and TailCut space reduction) brought to you by Axiom -
trie
Data structure and relevant algorithms for extremely fast prefix/fuzzy string searching. -
ttlcache
An in-memory cache with item expiration and generics [Moved to: https://github.com/jellydator/ttlcache] -
go-geoindex
Go native library for fast point tracking and K-Nearest queries -
Bloomfilter
Face-meltingly fast, thread-safe, marshalable, unionable, probability- and optimal-size-calculating Bloom filter in go -
go-adaptive-radix-tree
Adaptive Radix Trees implemented in Go -
goconcurrentqueue
Go concurrent-safe, goroutine-safe, thread-safe queue -
hilbert
Go package for mapping values to and from space-filling curves, such as Hilbert and Peano curves. -
cuckoo-filter
Cuckoo Filter go implement, better than Bloom Filter, configurable and space optimized 布谷鸟过滤器的Go实现,优于布隆过滤器,可以定制化过滤器参数,并进行了空间优化 -
ring
Package ring provides a high performance and thread safe Go implementation of a bloom filter. -
go-rquad
:pushpin: State of the art point location and neighbour finding algorithms for region quadtrees, in Go -
set
A simple Set data structure implementation in Go (Golang) using LinkedHashMap. -
nan
Zero allocation Nullable structures in one library with handy conversion functions, marshallers and unmarshallers -
goset
Set is a useful collection but there is no built-in implementation in Go lang. -
hide
ID type with marshalling to/from hash to prevent sending IDs to clients.
WorkOS - The modern identity platform for B2B SaaS
Do you think we are missing an alternative of merkle or a related project?
README
Merkle - Efficient calculation of merkle roots and proofs
This is merkle, a Go package for computing the Merkle root hash of a sequence of byte strings, or of their hashes. It can also produce a compact proof that a given string belongs in a Merkle tree with a given root hash.
This implementation does not require holding all of the input in memory while computing a root hash or a proof. Instead, it is able to operate on a stream of input strings of unbounded length, holding incremental state that is only logarithmic [O(log N)] in the size of the input.
For more about Merkle trees, see the Wikipedia article.
Creating a merkle root hash:
var ch <-chan []byte // Represents some source of byte strings
tree := merkle.NewTree(sha256.New())
for str := range ch {
tree.Add(str)
}
fmt.Printf("merkle root hash is %x\n", tree.Root())
Creating a merkle proof that ref
belongs in the tree,
then verifying the proof:
var (
ch <-chan []byte // Represents some source of byte strings
rootHash []byte // Represents a previously computed merkle root hash (held by someone wishing to verify that ref is in the tree)
ref []byte // Represents the string to prove is a member of the tree with the given root hash
)
tree := merkle.NewProofTree(sha256.New(), ref)
for str := range ch {
tree.Add(str)
}
proof := tree.Proof() // This is a compact object. For verification purposes, tree can now be discarded.
// Verification:
if bytes.Equal(rootHash, proof.Hash(sha256.New(), ref)) {
fmt.Println("Verified!")
}