class MerkleTree::Stream

Defined in:

merkle_tree_stream.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(leaf : MerkleTree::Node, Nil | Array(MerkleTree::Node) -> Slice(UInt8), parent : MerkleTree::Node, MerkleTree::Node -> Slice(UInt8), roots : Array(MerkleTree::Node) = [] of Node) #

Create a new MerkleTreeStream instance


[View source]

Instance Method Detail

def blocks : UInt64 #

[View source]
def leaf : Proc(Node, Array(Node) | Nil, Bytes) #

Pass data through a hash function


[View source]
def next(data : Bytes, nodes : Array(Node) = [] of Node) : Array(Node) #

Pass a string buffer through the flat-tree hash functions, and write the result back out to "nodes"


[View source]
def parent : Proc(Node, Node, Bytes) #

Pass hashes through a hash function


[View source]
def roots : Array(Node) #

[View source]