Stroika Library 3.0d24
 
Loading...
Searching...
No Matches
HashBase.h
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2026. All rights reserved
3 */
4#ifndef _Stroika_Foundation_Cryptography_Digest_HashBase_h_
5#define _Stroika_Foundation_Cryptography_Digest_HashBase_h_ 1
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
9#include <concepts>
10#include <functional>
11
12#include "Stroika/Foundation/Common/Common.h"
13
14/*
15 * \note Code-Status: <a href="Code-Status.md#Alpha">Alpha</a>
16 *
17 * \note - this separate file exists to avoid mutual include issues - it logically would make sense to
18 * include this in Hash.h
19 */
20
21namespace Stroika::Foundation::Cryptography::Digest {
22
23 /**
24 * \brief check argument FUNCTION is callable with a HASHABLE_T, and produces (something convertible to) size_t
25 *
26 * see https://stackoverflow.com/questions/65127936/defining-a-c20-concept-for-hash-functions
27 * https://en.cppreference.com/w/cpp/utility/hash
28 */
29 template <typename FUNCTION, typename HASHABLE_T>
30 concept IHashFunction = regular_invocable<FUNCTION, HASHABLE_T> and requires (FUNCTION f, HASHABLE_T t) {
31 { invoke (f, t) } -> convertible_to<size_t>;
32 };
33
34}
35
36/*
37 ********************************************************************************
38 ***************************** Implementation Details ***************************
39 ********************************************************************************
40 */
41#include "HashBase.inl"
42
43#endif /*_Stroika_Foundation_Cryptography_Digest_HashBase_h_*/
check argument FUNCTION is callable with a HASHABLE_T, and produces (something convertible to) size_t
Definition HashBase.h:30