openMSX
Classes | Public Member Functions | List of all members
openmsx::TigerTree Class Reference

Calculate a tiger-tree-hash. More...

#include <TigerTree.hh>

Public Member Functions

 TigerTree (TTData &data, size_t dataSize, const std::string &name)
 Create TigerTree calculator for the given (abstract) data block of given size. More...
 
const TigerHashcalcHash (const std::function< void(size_t, size_t)> &progressCallback)
 Calculate the hash value. More...
 
void notifyChange (size_t offset, size_t len, time_t time)
 Inform this calculator about changes in the input data. More...
 

Detailed Description

Calculate a tiger-tree-hash.

Calculation can be done incrementally, so recalculating the hash after a (small) modification of the input is efficient.

Definition at line 72 of file TigerTree.hh.

Constructor & Destructor Documentation

◆ TigerTree()

openmsx::TigerTree::TigerTree ( TTData data,
size_t  dataSize,
const std::string &  name 
)

Create TigerTree calculator for the given (abstract) data block of given size.

Definition at line 47 of file TigerTree.cc.

Member Function Documentation

◆ calcHash()

const TigerHash & openmsx::TigerTree::calcHash ( const std::function< void(size_t, size_t)> &  progressCallback)

Calculate the hash value.

Definition at line 54 of file TigerTree.cc.

Referenced by notifyChange(), and TEST_CASE().

◆ notifyChange()

void openmsx::TigerTree::notifyChange ( size_t  offset,
size_t  len,
time_t  time 
)

Inform this calculator about changes in the input data.

This is used to (not) skip re-calculations on future calcHash() calls. So it's crucial this calculator is informed about all changes in the input.

Definition at line 59 of file TigerTree.cc.

References calcHash(), Math::floodRight(), openmsx::TTData::getData(), openmsx::TTCacheEntry::hash, openmsx::TTCacheEntry::numNodes, openmsx::TTCacheEntry::numNodesValid, openmsx::tiger(), openmsx::tiger_int(), openmsx::tiger_leaf(), openmsx::TTCacheEntry::time, and openmsx::TTCacheEntry::valid.

Referenced by TEST_CASE().


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