22 #ifndef NDN_CXX_UTIL_SHA256_HPP
23 #define NDN_CXX_UTIL_SHA256_HPP
45 class Error :
public std::runtime_error
48 using std::runtime_error::runtime_error;
104 return !(*
this == digest);
145 update(span<const uint8_t> buffer);
162 unique_ptr<security::transform::StepSource> m_input;
163 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.
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.
static constexpr size_t DIGEST_SIZE
Length in bytes of a SHA-256 digest.
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.
std::shared_ptr< const Buffer > ConstBufferPtr