9#include <aws/cal/hash.h>
31 size_t truncateTo = 0) noexcept;
52 size_t truncateTo = 0) noexcept;
79 inline operator bool() const noexcept {
return m_good; }
84 inline int LastError() const noexcept {
return m_lastError; }
100 bool Update(
const ByteCursor &toHash)
noexcept;
108 bool Digest(
ByteBuf &output,
size_t truncateTo = 0) noexcept;
111 Hash(aws_hash *hash) noexcept;
134 aws_hash *SeatForCInterop(
const std::shared_ptr<ByoHash> &selfRef);
155 static
void s_Destroy(struct aws_hash *hash);
156 static
int s_Update(struct aws_hash *hash, const struct aws_byte_cursor *buf);
157 static
int s_Finalize(struct aws_hash *hash, struct aws_byte_buf *out);
159 static aws_hash_vtable s_Vtable;
160 aws_hash m_hashValue;
#define AWS_CRT_CPP_API
Definition: Exports.h:37
virtual bool DigestInternal(ByteBuf &output, size_t truncateTo=0) noexcept=0
virtual bool UpdateInternal(const ByteCursor &toHash) noexcept=0
int LastError() const noexcept
Definition: Hash.h:84
Hash & operator=(const Hash &)=delete
Hash(const Hash &)=delete
bool AWS_CRT_CPP_API ComputeMD5(Allocator *allocator, const ByteCursor &input, ByteBuf &output, size_t truncateTo=0) noexcept
Definition: Hash.cpp:29
std::function< std::shared_ptr< ByoHash >(size_t digestSize, Allocator *)> CreateHashCallback
Definition: Hash.h:164
static const size_t SHA256_DIGEST_SIZE
Definition: Hash.h:18
bool AWS_CRT_CPP_API ComputeSHA256(Allocator *allocator, const ByteCursor &input, ByteBuf &output, size_t truncateTo=0) noexcept
Definition: Hash.cpp:15
static const size_t MD5_DIGEST_SIZE
Definition: Hash.h:19
aws_byte_cursor ByteCursor
Definition: Types.h:33
aws_allocator Allocator
Definition: StlAllocator.h:17
AWS_CRT_CPP_API Allocator * g_allocator
Definition: Api.cpp:23
aws_byte_buf ByteBuf
Definition: Types.h:32
Definition: StringView.h:851