CatapultServer  v0.5.0.1 (Elephant)
catapult::crypto::MerkleHashBuilder Class Reference

Builder for creating a merkle hash. More...

Public Member Functions

 MerkleHashBuilder (size_t capacity=0)
 Creates a new merkle hash builder with the specified initial capacity. More...
 
void update (const Hash256 &hash)
 Adds hash to the merkle hash. More...
 
void final (Hash256 &hash)
 Finalizes the merkle hash into hash. More...
 
void final (std::vector< Hash256 > &tree)
 Finalizes the complete merkle tree into tree. More...
 

Static Public Member Functions

static size_t TreeSize (size_t leafCount)
 Calculates the number of nodes in a merkle tree with leafCount leaves. More...
 

Private Attributes

std::vector< Hash256m_hashes
 

Detailed Description

Builder for creating a merkle hash.

Constructor & Destructor Documentation

◆ MerkleHashBuilder()

catapult::crypto::MerkleHashBuilder::MerkleHashBuilder ( size_t  capacity = 0)
explicit

Creates a new merkle hash builder with the specified initial capacity.

Member Function Documentation

◆ final() [1/2]

void catapult::crypto::MerkleHashBuilder::final ( Hash256 hash)

Finalizes the merkle hash into hash.

Here is the caller graph for this function:

◆ final() [2/2]

void catapult::crypto::MerkleHashBuilder::final ( std::vector< Hash256 > &  tree)

Finalizes the complete merkle tree into tree.

Here is the call graph for this function:

◆ TreeSize()

size_t catapult::crypto::MerkleHashBuilder::TreeSize ( size_t  leafCount)
static

Calculates the number of nodes in a merkle tree with leafCount leaves.

Here is the caller graph for this function:

◆ update()

void catapult::crypto::MerkleHashBuilder::update ( const Hash256 hash)

Adds hash to the merkle hash.

Here is the caller graph for this function:

Member Data Documentation

◆ m_hashes

std::vector<Hash256> catapult::crypto::MerkleHashBuilder::m_hashes
private

The documentation for this class was generated from the following files: