diff --git a/Chaos/Hashing/Hasher.hpp b/Chaos/Hashing/Hasher.hpp new file mode 100644 index 0000000..cd86db6 --- /dev/null +++ b/Chaos/Hashing/Hasher.hpp @@ -0,0 +1,25 @@ +#ifndef CHAOS_HASHING_HASHER_HPP +#define CHAOS_HASHING_HASHER_HPP + +namespace Chaos::Hashing +{ + +template +class Hasher +{ +public: + template + void Update(InputIt begin, InputIt end) + { + static_cast(*this).Update(begin, end); + } + + auto Finish() + { + return static_cast(*this).Finish(); + } +}; + +} // namespace Chaos::Hashing + +#endif diff --git a/Chaos/Hashing/Md4.hpp b/Chaos/Hashing/Md4.hpp index e1e34e5..807d5e6 100644 --- a/Chaos/Hashing/Md4.hpp +++ b/Chaos/Hashing/Md4.hpp @@ -6,6 +6,7 @@ #include #include "Hash.hpp" +#include "Hasher.hpp" namespace Chaos::Hashing::Md4 { @@ -148,7 +149,7 @@ struct Md4Hash : public Hash std::array RawDigest; }; -class Md4Hasher +class Md4Hasher : public Hasher { public: Md4Hasher()