22 #ifndef NDN_CXX_UTIL_SHA256_HPP
23 #define NDN_CXX_UTIL_SHA256_HPP
47 class Error :
public std::runtime_error
50 using std::runtime_error::runtime_error;
106 return !(*
this == digest);
147 update(span<const uint8_t> buffer);
164 unique_ptr<security::transform::StepSource> m_input;
165 unique_ptr<OBufferStream> m_output;
Provides stateful SHA-256 digest calculation.
ConstBufferPtr computeDigest()
Finalize and return the digest based on all previously supplied inputs.
bool empty() const
Check if digest is empty.
Sha256()
Create an empty SHA-256 digest.
static const size_t DIGEST_SIZE
Length in bytes of a SHA-256 digest.
bool operator==(Sha256 &digest)
Check if the supplied digest is equal to this digest.
Sha256 & operator<<(Sha256 &src)
Add existing digest to the digest calculation.
bool operator!=(Sha256 &digest)
Check if the supplied digest is not equal to this digest.
std::string toString()
Convert digest to std::string.
void reset()
Discard the current state and start a new digest calculation.
void update(span< const uint8_t > buffer)
Add a byte buffer to the digest calculation.
std::ostream & operator<<(std::ostream &os, LogLevel level)
Output LogLevel as a string.
shared_ptr< const Buffer > ConstBufferPtr