Files
hashlag e328249a6d
Chaos Ci / test (push) Successful in 2m57s
Chaos Ci / benchmark (push) Successful in 1m24s
Rename Hasher::BlockSizeBytes –> BlockSize.
2026-09-13 00:51:20 +03:00

29 lines
594 B
C++

#ifndef CHAOS_HASH_HASHER_HPP
#define CHAOS_HASH_HASHER_HPP
#include <concepts>
#include <cstdint>
#include <type_traits>
#include "Hash.hpp"
namespace Chaos::Hash
{
template<typename T>
concept Hasher = requires(T hasher, uint8_t * begin, uint8_t * end)
{
typename T::HashType;
requires std::unsigned_integral<std::remove_cvref_t<decltype(T::BlockSize)>>;
typename std::integral_constant<decltype(T::BlockSize), T::BlockSize>;
hasher.Reset();
hasher.Update(begin, end);
{ hasher.Finish() } -> Hash;
};
} // namespace Chaos::Hash
#endif // CHAOS_HASH_HASHER_HPP