Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::IHashAlgorithmContext Class Referenceabstract

Context for calculating a hash incrementally. More...

#include <arcane/utils/IHashAlgorithm.h>

Inheritance diagram for Arcane::IHashAlgorithmContext:
Collaboration diagram for Arcane::IHashAlgorithmContext:

Public Member Functions

virtual void reset ()=0
 Resets the instance to calculate a new hash value.
virtual void updateHash (Span< const std::byte > input)=0
 Adds the array input to the calculated hash.
virtual void computeHashValue (HashAlgorithmValue &hash_value)=0
 Calculates the hash value and returns it in hash_value.

Detailed Description

Context for calculating a hash incrementally.

The same context can be used multiple times by calling reset() to reset the instance.

IHashAlgorithm* algo = ...;
HashAlgorithmValue hash_value;
hash_value.reserve(algo->hashSize());
Ref<IHashContext> context = algo->createContext();
context->updateHash(array1);
context->updateHash(array2);
context->computeHashValue(hash_value);
Hash algorithm return value.
Interface of a hashing algorithm.
virtual Int32 hashSize() const
Size (in bytes) of the hash key.
virtual Ref< IHashAlgorithmContext > createContext()
Creates a context to calculate the hash value incrementally.
Reference to an instance.
1D data vector with value semantics (STL style).

Definition at line 84 of file IHashAlgorithm.h.

Member Function Documentation

◆ computeHashValue()

virtual void Arcane::IHashAlgorithmContext::computeHashValue ( HashAlgorithmValue & hash_value)
pure virtual

Calculates the hash value and returns it in hash_value.

Implemented in Arcane::SHA1Algorithm::SHA1.

◆ reset()

virtual void Arcane::IHashAlgorithmContext::reset ( )
pure virtual

Resets the instance to calculate a new hash value.

Implemented in Arcane::SHA1Algorithm::SHA1.

◆ updateHash()

virtual void Arcane::IHashAlgorithmContext::updateHash ( Span< const std::byte > input)
pure virtual

Adds the array input to the calculated hash.

Implemented in Arcane::SHA1Algorithm::SHA1.


The documentation for this class was generated from the following file: