20namespace Azure {
namespace Core {
namespace Cryptography {
36 virtual void OnAppend(
const uint8_t* data,
size_t length) = 0;
46 virtual std::vector<uint8_t> OnFinal(
const uint8_t* data,
size_t length) = 0;
65 void Append(
const uint8_t* data,
size_t length)
69 OnAppend(data, length);
81 std::vector<uint8_t>
Final(
const uint8_t* data,
size_t length)
86 return OnFinal(data, length);
96 std::vector<uint8_t>
Final() {
return Final(
nullptr, 0); }
105 bool m_isDone =
false;
117 void operator=(
Hash const&) =
delete;
145 std::unique_ptr<Hash> m_implementation;
155 std::vector<uint8_t> OnFinal(
const uint8_t* data,
size_t length)
override;
166 void OnAppend(
const uint8_t* data,
size_t length)
override;
Provide assert macros to use with pre-conditions.
#define AZURE_ASSERT(exp)
Azure specific assert macro.
Definition azure_assert.hpp:51
#define AZURE_ASSERT_MSG(exp, msg)
Azure specific assert macro with message.
Definition azure_assert.hpp:53
Represents the base class for hash algorithms which map binary data of an arbitrary length to small b...
Definition hash.hpp:26
virtual ~Hash()=default
Destructs Hash.
Hash()=default
Constructs a default instance of Hash.
std::vector< uint8_t > Final(const uint8_t *data, size_t length)
Computes the hash value of the specified binary input data, including any previously appended.
Definition hash.hpp:81
void Append(const uint8_t *data, size_t length)
Used to append partial binary input data to compute the hash in a streaming fashion.
Definition hash.hpp:65
std::vector< uint8_t > Final()
Computes the hash value of all the binary input data appended to the instance so far.
Definition hash.hpp:96
Represents the class for the MD5 hash function which maps binary data of an arbitrary length to small...
Definition hash.hpp:129
~Md5Hash() override
Destructs Md5Hash.
Md5Hash()
Construct a default instance of Azure::Core::Cryptography::Md5Hash.
Compute the hash value for the input binary data, using SHA256, SHA384 and SHA512.
Definition azure_assert.hpp:57