Update concept Hasher: require T::BLOCK_SIZE_BYTES.

This commit is contained in:
hashlag committed 2026-09-12 02:49:12 +03:00
1 parent cb8b6ceeb8
commit 97aeb229ad
1 file changed
+3
+3
View File
@@ -1,7 +1,9 @@
#ifndef CHAOS_HASH_HASHER_HPP #ifndef CHAOS_HASH_HASHER_HPP
#define CHAOS_HASH_HASHER_HPP #define CHAOS_HASH_HASHER_HPP
#include <concepts>
#include <cstdint> #include <cstdint>
#include <type_traits>
#include "Hash.hpp" #include "Hash.hpp"
@@ -12,6 +14,7 @@ template<typename T>
concept Hasher = requires(T hasher, uint8_t * begin, uint8_t * end) concept Hasher = requires(T hasher, uint8_t * begin, uint8_t * end)
{ {
typename T::HashType; typename T::HashType;
requires std::unsigned_integral<std::remove_cvref_t<decltype(T::BLOCK_SIZE_BYTES)>>;
hasher.Reset(); hasher.Reset();
hasher.Update(begin, end); hasher.Update(begin, end);
{ hasher.Finish() } -> Hash; { hasher.Finish() } -> Hash;