Introduce a base class for hashers

This commit is contained in:
hashlag
2025-08-09 19:34:58 +03:00
parent 3841242bdb
commit 39344fe01c
3 changed files with 29 additions and 2 deletions

25
Chaos/Hashing/Hasher.hpp Normal file
View File

@@ -0,0 +1,25 @@
#ifndef CHAOS_HASHING_HASHER_HPP
#define CHAOS_HASHING_HASHER_HPP
namespace Chaos::Hashing
{
template<typename T>
class Hasher
{
public:
template<typename InputIt>
void Update(InputIt begin, InputIt end)
{
static_cast<T &>(*this).Update(begin, end);
}
auto Finish()
{
return static_cast<T &>(*this).Finish();
}
};
} // namespace Chaos::Hashing
#endif