AWS IoT Device SDK C++ v2
1.34.0
AWS IoT Device SDK C++ v2
|
#include <Hash.h>
Public Member Functions | |
~Hash () | |
Hash (const Hash &)=delete | |
Hash & | operator= (const Hash &)=delete |
Hash (Hash &&toMove) | |
Hash & | operator= (Hash &&toMove) |
operator bool () const noexcept | |
int | LastError () const noexcept |
bool | Update (const ByteCursor &toHash) noexcept |
bool | Digest (ByteBuf &output, size_t truncateTo=0) noexcept |
bool | ComputeOneShot (const ByteCursor &input, ByteBuf &output, size_t truncateTo=0) noexcept |
size_t | DigestSize () const noexcept |
Static Public Member Functions | |
static Hash | CreateSHA256 (Allocator *allocator=ApiAllocator()) noexcept |
static Hash | CreateSHA1 (Allocator *allocator=ApiAllocator()) noexcept |
static Hash | CreateMD5 (Allocator *allocator=ApiAllocator()) noexcept |
Streaming Hash object. The typical use case is for computing the hash of an object that is too large to load into memory. You can call Update() multiple times as you load chunks of data into memory. When you're finished simply call Digest(). After Digest() is called, this object is no longer usable.
Aws::Crt::Crypto::Hash::~Hash | ( | ) |
|
delete |
Aws::Crt::Crypto::Hash::Hash | ( | Hash && | toMove | ) |
|
noexcept |
Computes the hash of input and writes the digest into output. The available capacity of output must be large enough for the digest. See: SHA1_DIGEST_SIZE, SHA256_DIGEST_SIZE and MD5_DIGEST_SIZE for size hints. 'truncateTo' is for if you want truncated output (e.g. you only want the first 16 bytes of a SHA256 digest. Returns true on success. Call LastError() for the reason this call failed.
This is an API a user would use for smaller size inputs. For larger, streaming inputs, use multiple calls to Update() for each buffer, followed by a single call to Digest().
|
staticnoexcept |
Creates an instance of a Streaming MD5 Hash.
|
staticnoexcept |
Creates an instance of a Stream SHA1 Hash.
|
staticnoexcept |
Creates an instance of a Streaming SHA256 Hash.
|
noexcept |
Finishes the running hash operation and writes the digest into output. The available capacity of output must be large enough for the digest. See: SHA1_DIGEST_SIZE, SHA256_DIGEST_SIZE and MD5_DIGEST_SIZE for size hints. 'truncateTo' is for if you want truncated output (e.g. you only want the first 16 bytes of a SHA256 digest. Returns true on success. Call LastError() for the reason this call failed.
|
noexcept |
Returns the size of the digest for this hash algorithm. If this object is not valid, it will return 0 instead.
|
inlinenoexcept |
Returns the value of the last aws error encountered by operations on this instance.
|
noexcept |
Returns true if the instance is in a valid state, false otherwise.
|
noexcept |
Updates the running hash object with data in toHash. Returns true on success. Call LastError() for the reason this call failed.