ark::crypt::HashContext

Defined in header “ark/crypt/hash.hh”.


This class allows you to compute a hash over incoming content that might not all arrive at the same time (for example, to update it with multiple independent data blocks).

Methods

  • HashContext(HashAlgorithm algorithm)
    Constructor. Initializes the context with the given algorithm.

  • ~HashContext()
    Destructor, cleans up resources.

  • HashContext(const HashContext & other)

  • HashContext(HashContext && other)

  • HashContext & operator=(const HashContext & other)

  • HashContext & operator=(HashContext && other)

  • void update(const std::string_view & content)
    Updates the state of the hash with the incoming data.

  • std::string raw_str()
    Returns a ‘raw’ hash digest (raw bytes) suitable for being placed into a bignum. Can only be invoked once.

  • std::string hex_str()
    Returns the final hex-encoded digest suitable for display. Can only be invoked once.