Classes | Public Member Functions | Static Public Attributes | 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.
const TigerHashcalcHash (const std::function< void(size_t, size_t)> &progressCallback)
 Calculate the hash value.
void notifyChange (size_t offset, size_t len, time_t time)
 Inform this calculator about changes in the input data.

Static Public Attributes

static constexpr size_t BLOCK_SIZE = 1024

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

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

References calcHash().

Referenced by calcHash(), 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

References BLOCK_SIZE, openmsx::TTCacheEntry::numNodesValid, openmsx::TTCacheEntry::time, and openmsx::TTCacheEntry::valid.

Referenced by TEST_CASE().

Member Data Documentation


constexpr size_t openmsx::TigerTree::BLOCK_SIZE = 1024

Definition at line 75 of file TigerTree.hh.

Referenced by notifyChange(), and TEST_CASE().

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