merkle_tree alternatives and similar packages
Based on the "Algorithms and Data structures" category.
Alternatively, view merkle_tree alternatives based on common mentions on social networks and blogs.
-
matrex
A blazing fast matrix library for Elixir/Erlang with C implementation using CBLAS. -
simple_bayes
A Naive Bayes machine learning implementation in Elixir. -
exconstructor
An Elixir library for generating struct constructors that handle external data with ease. -
erlang-algorithms
Implementations of popular data structures and algorithms -
remodel
:necktie: An Elixir presenter package used to transform map structures. "ActiveModel::Serializer for Elixir" -
MapDiff
Calculates the difference between two (nested) maps, and returns a map representing the patch of changes. -
aja
Extension of the Elixir standard library focused on data stuctures, data manipulation and performance -
parallel_stream
A parallelized stream implementation for Elixir -
bloomex
:hibiscus: A pure Elixir implementation of Scalable Bloom Filters -
DeepMerge
Deep (recursive) merge for maps, keywords and others in Elixir -
exmatrix
Elixir library implementing a parallel matrix multiplication algorithm and other utilities for working with matrices. Used for benchmarking computationally intensive concurrent code. -
the_fuzz
String metrics and phonetic algorithms for Elixir (e.g. Dice/Sorensen, Hamming, Jaccard, Jaro, Jaro-Winkler, Levenshtein, Metaphone, N-Gram, NYSIIS, Overlap, Ratcliff/Obershelp, Refined NYSIIS, Refined Soundex, Soundex, Weighted Levenshtein) -
ecto_materialized_path
Tree structure & hierarchy for ecto models -
dataframe
Package providing functionality similar to Python's Pandas or R's data.frame() -
Conrex
An Elixir implementation of the CONREC algorithm for topographic or isochrone maps. -
murmur
:speech_balloon: An implementation of the non-cryptographic hash Murmur3 -
bitmap
Bitmap implementation in Elixir using binaries and integers. Fast space efficient data structure for lookups -
Closure Table
Closure Table for Elixir - a simple solution for storing and manipulating complex hierarchies. -
paratize
Elixir library providing some handy parallel processing facilities that supports configuring number of workers and timeout.
Free Global Payroll designed for tech teams
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of merkle_tree or a related project?
README
MerkleTree
Merkle Tree implementation in pure Elixir.
Hex (Package Manager)
API Documentation
Installation
Install the Elixir functional language.
Create New Project with Mix
mix new my_app; cd my_app
Add
merkle_tree
to your list of dependencies inmix.exs
.def deps do [{:merkle_tree, "~> 1.6.0"}] end
Install Mix Dependencies
mix deps.get
Usage
Run Interactive Elixir (IEx) within context of Elixir app and dependencies injected into IEx runtime
iex -S mix
Try the MerkleTree Module
iex> MerkleTree.__info__(:functions) [__struct__: 0, __struct__: 1, build: 2, new: 1, new: 2] iex> mt = MerkleTree.new ['a', 'b', 'c', 'd'] %MerkleTree{blocks: ['a', 'b', 'c', 'd'], hash_function: &MerkleTree.Crypto.sha256/1, root: %MerkleTree.Node{children: [%MerkleTree.Node{children: [%MerkleTree.Node{children: [], value: "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb"}, %MerkleTree.Node{children: [], value: "3e23e8160039594a33894f6564e1b1348bbd7a0088d42c4acb73eeaed59c009d"}], value: "62af5c3cb8da3e4f25061e829ebeea5c7513c54949115b1acc225930a90154da"}, %MerkleTree.Node{children: [%MerkleTree.Node{children: [], value: "2e7d2c03a9507ae265ecf5b5356885a53393a2029d241394997265a1a25aefc6"}, %MerkleTree.Node{children: [], value: "18ac3e7343f016890c510e93f935261169d9e3f565436429830faf0934f4f8e4"}], value: "d3a0f1c792ccf7f1708d5422696263e35755a86917ea76ef9242bd4a8cf4891a"}], value: "58c89d709329eb37285837b042ab6ff72c7c8f74de0446b091b6a0131c102cfd"}} $ mt.blocks() ['a', 'b', 'c', 'd'] $ mt.hash_function() &MerkleTree.Crypto.sha256/1 $ mt.root() ...
Try the MerkleTree.Proof Module (requires merkle_tree >1.2.0)
iex> MerkleTree.Proof.__info__(:functions) [__struct__: 0, __struct__: 1, prove: 2, proven?: 3] iex> proof1 = MerkleTree.Proof.prove(mt, 1) iex> proven1 = MerkleTree.Proof.proven?({"b", 1}, "58c89d709329eb37285837b042ab6ff72c7c8f74de0446b091b6a0131c102cfd", proof1) true
iex> proof3 = MerkleTree.Proof.prove(mt, 3) %MerkleTree.Proof{
hash_function: &MerkleTree.Crypto.sha256/1,
hashes: ["62af5c3cb8da3e4f25061e829ebeea5c7513c54949115b1acc225930a90154da",
"2e7d2c03a9507ae265ecf5b5356885a53393a2029d241394997265a1a25aefc6"]
}
iex> proven3 = MerkleTree.Proof.proven?({"d", 3}, "58c89d709329eb37285837b042ab6ff72c7c8f74de0446b091b6a0131c102cfd", proof3)
true
* Try the [MerkleTree.Crypto Module](https://hexdocs.pm/merkle_tree/MerkleTree.Crypto.html)
```elixir
iex> MerkleTree.Crypto.__info__(:functions)
[hash: 2, sha256: 1]
iex> MerkleTree.Crypto.hash("tendermint", :sha256)
"f6c3848fc2ab9188dd2c563828019be7cee4e269f5438c19f5173f79898e9ee6"
iex> MerkleTree.Crypto.hash("tendermint", :md5)
"bc93700bdf1d47ad28654ad93611941f"
iex> MerkleTree.Crypto.sha256("tendermint")
"f6c3848fc2ab9188dd2c563828019be7cee4e269f5438c19f5173f79898e9ee6"
Background
A hash tree or Merkle tree is a tree in which every non-leaf node is labelled with the hash of the labels or values (in case of leaves) of its child nodes. Hash trees are useful because they allow efficient and secure verification of the contents of large data structures. Hash trees are a generalization of hash lists and hash chains.
Hash trees can be used to verify any kind of data stored, handled and transferred in and between computers. Currently the main use of hash trees is to make sure that data blocks received from other peers in a peer-to-peer network are received undamaged and unaltered, and even to check that the other peers do not lie and send fake blocks. Suggestions have been made to use hash trees in trusted computing systems. Hash trees are used in the IPFS and ZFS file systems, BitTorrent protocol, Apache Wave protocol, Git distributed revision control system, the Bitcoin peer-to-peer network, the Ethereum peer-to-peer network, and a number of NoSQL systems like Apache Cassandra and Riak.
Running Type Checker
mix dialyzer
Contributing
- Fork it ( http://github.com/Leventhan/merkle_tree/fork )
- Create your feature branch (
git checkout -b feature/my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin feature/my-new-feature
) - Create a new Pull Request (Remember to squash your commits!)
Kindly report any found bugs or errors using the issue tracker.
Thanks
merkle_tree © 2016+, Yos Riady. Released under the MIT License. Authored and maintained by Yos Riady with help from contributors (list).
*Note that all licence references and agreements mentioned in the merkle_tree README section above
are relevant to that project's source code only.