openMSX
|
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 TigerHash & | calcHash (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 |
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.
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 48 of file TigerTree.cc.
const TigerHash & openmsx::TigerTree::calcHash | ( | const std::function< void(size_t, size_t)> & | progressCallback | ) |
Calculate the hash value.
Definition at line 55 of file TigerTree.cc.
References calcHash().
Referenced by calcHash(), and TEST_CASE().
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 60 of file TigerTree.cc.
References BLOCK_SIZE, openmsx::TTCacheEntry::nodes, openmsx::TTCacheEntry::numNodesValid, and openmsx::TTCacheEntry::time.
Referenced by TEST_CASE().
|
staticconstexpr |
Definition at line 75 of file TigerTree.hh.
Referenced by notifyChange(), and TEST_CASE().