4#ifndef _Stroika_Foundation_Cryptography_Digest_Digester_h_
5#define _Stroika_Foundation_Cryptography_Digest_Digester_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
11#include "Stroika/Foundation/Common/Common.h"
12#include "Stroika/Foundation/Cryptography/Digest/Algorithm/Algorithm.h"
21namespace Stroika::Foundation::Cryptography::Digest {
90 template <typename ALGORITHM, typename RETURN_TYPE = typename Algorithm::DigesterDefaultTraitsForAlgorithm<ALGORITHM>::ReturnType>
91 RETURN_TYPE ComputeDigest (
const Streams::InputStream::Ptr<byte>& from);
92 template <typename ALGORITHM, typename RETURN_TYPE = typename Algorithm::DigesterDefaultTraitsForAlgorithm<ALGORITHM>::ReturnType>
93 RETURN_TYPE ComputeDigest (
const byte* from,
const byte* to);
94 template <typename ALGORITHM, typename RETURN_TYPE = typename Algorithm::DigesterDefaultTraitsForAlgorithm<ALGORITHM>::ReturnType>
95 RETURN_TYPE ComputeDigest (span<const byte> from);
96 template <typename ALGORITHM, typename RETURN_TYPE = typename Algorithm::DigesterDefaultTraitsForAlgorithm<ALGORITHM>::ReturnType>
97 RETURN_TYPE ComputeDigest (
const BLOB& from);
98 template <typename ALGORITHM, typename TRIVIALLY_COPYABLE_T, typename RETURN_TYPE = typename Algorithm::DigesterDefaultTraitsForAlgorithm<ALGORITHM>::ReturnType>
99 RETURN_TYPE ComputeDigest (
const Traversal::Iterable<TRIVIALLY_COPYABLE_T>& from)
100 requires (is_trivially_copyable_v<TRIVIALLY_COPYABLE_T>);
134 template <typename ALGORITHM, typename RETURN_TYPE = typename Algorithm::DigesterDefaultTraitsForAlgorithm<ALGORITHM>::ReturnType>
137 using ReturnType = RETURN_TYPE;
154 nonvirtual
void Write (
const byte* from,
const byte* to);
155 nonvirtual
void Write (span<const byte> from);
156 nonvirtual
void Write (
const BLOB& from);
158 template <
typename TRIVIALLY_COPYABLE_T>
160 requires (is_trivially_copyable_v<TRIVIALLY_COPYABLE_T>);
172#if qStroika_Foundation_Debug_AssertionsChecked
173 bool fCompleted_{
false};
237 template <typename ALGORITHM, typename RETURN_TYPE = typename Algorithm::DigesterDefaultTraitsForAlgorithm<ALGORITHM>::ReturnType>
240 using ReturnType = RETURN_TYPE;
261 nonvirtual ReturnType
operator() (
const byte* from,
const byte* to)
const;
262 nonvirtual ReturnType
operator() (span<const byte> from)
const;
264 template <
typename TRIVIALLY_COPYABLE_T>
266 requires (is_trivially_copyable_v<TRIVIALLY_COPYABLE_T>);
276#include "Digester.inl"
DigesterAlgorithm is specialized for each algorithm; generally don't use this directly,...
Digester<ALGORITHM> is a function-object way to access the digest algorithm. Its generally almost the...
nonvirtual ReturnType operator()(const Streams::InputStream::Ptr< byte > &from) const
IncrementalDigester<ALGORITHM> () is the low level way to call Digest algorithms, appropriate for str...
nonvirtual ReturnType Complete()
nonvirtual void Write(const byte *from, const byte *to)
Iterable<T> is a base class for containers which easily produce an Iterator<T> to traverse them.