class MerkleTree::Stream
- MerkleTree::Stream
- Reference
- Object
Defined in:
merkle_tree_stream.crConstructors
-
.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
Instance Method Summary
- #blocks : UInt64
-
#leaf : Proc(Node, Array(Node) | Nil, Bytes)
Pass data through a hash function
-
#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"
-
#parent : Proc(Node, Node, Bytes)
Pass hashes through a hash function
- #roots : Array(Node)
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
Instance Method Detail
Pass a string buffer through the flat-tree hash functions, and write the result back out to "nodes"