Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::IHashAlgorithm Class Referenceabstract

Interface of a hashing algorithm. More...

#include <arcane/utils/IHashAlgorithm.h>

Public Member Functions

virtual String name () const
 Name of the algorithm.
virtual Int32 hashSize () const
 Size (in bytes) of the hash key.
virtual void computeHash64 (Span< const Byte > input, ByteArray &output)
 Calculates the hash value for the array input.
virtual void computeHash64 (Span< const std::byte > input, ByteArray &output)
 Calculates the hash value for the array input.
virtual void computeHash (Span< const std::byte > input, HashAlgorithmValue &value)
 Calculates the hash value for the array input.
virtual Ref< IHashAlgorithmContextcreateContext ()
 Creates a context to calculate the hash value incrementally.
virtual bool hasCreateContext () const
 Indicates if the implementation supports incremental hashing.
virtual void computeHash (ByteConstArrayView input, ByteArray &output)=0
 Calculates the hash value for the array input.

Detailed Description

Interface of a hashing algorithm.

Definition at line 108 of file IHashAlgorithm.h.

Member Function Documentation

◆ computeHash() [1/2]

virtual void Arcane::IHashAlgorithm::computeHash ( ByteConstArrayView input,
ByteArray & output )
pure virtual

Calculates the hash value for the array input.

The hash value is added to output. The length depends on the algorithm used.

Implemented in Arcane::MD5HashAlgorithm, Arcane::SHA1HashAlgorithm, and Arcane::SHA3HashAlgorithm.

References computeHash().

◆ computeHash() [2/2]

void Arcane::IHashAlgorithm::computeHash ( Span< const std::byte > input,
HashAlgorithmValue & value )
virtual

Calculates the hash value for the array input.

The hash value is positioned in value

Reimplemented in Arcane::SHA1HashAlgorithm.

Definition at line 77 of file HashAlgorithm.cc.

References computeHash64(), and Arcane::AbstractArray< T >::size().

Referenced by computeHash(), and computeHash64().

◆ computeHash64() [1/2]

void Arcane::IHashAlgorithm::computeHash64 ( Span< const Byte > input,
ByteArray & output )
virtual

Calculates the hash value for the array input.

The hash value is added to output. The added length is equal to hashSize().

Reimplemented in Arcane::MD5HashAlgorithm, Arcane::SHA1HashAlgorithm, and Arcane::SHA3HashAlgorithm.

Definition at line 58 of file HashAlgorithm.cc.

References computeHash(), and Arcane::SpanImpl< T, SizeType, Extent >::smallView().

Referenced by Arcane::MeshUtils::checkUniqueIdsHashCollective(), computeHash(), Arcane::SerializedData::computeHash(), and computeHash64().

◆ computeHash64() [2/2]

void Arcane::IHashAlgorithm::computeHash64 ( Span< const std::byte > input,
ByteArray & output )
virtual

Calculates the hash value for the array input.

The hash value is added to output. The added length is equal to hashSize().

Reimplemented in Arcane::MD5HashAlgorithm, Arcane::SHA1HashAlgorithm, and Arcane::SHA3HashAlgorithm.

Definition at line 67 of file HashAlgorithm.cc.

References computeHash64(), Arcane::SpanImpl< T, SizeType, Extent >::data(), and Arcane::SpanImpl< T, SizeType, Extent >::size().

◆ createContext()

Ref< IHashAlgorithmContext > Arcane::IHashAlgorithm::createContext ( )
virtual

Creates a context to calculate the hash value incrementally.

If the implementation does not support incremental mode (hasCreateContext()==false), an exception is thrown.

Reimplemented in Arcane::SHA1HashAlgorithm.

Definition at line 92 of file HashAlgorithm.cc.

◆ hasCreateContext()

virtual bool Arcane::IHashAlgorithm::hasCreateContext ( ) const
inlinevirtual

Indicates if the implementation supports incremental hashing.

Reimplemented in Arcane::SHA1HashAlgorithm.

Definition at line 165 of file IHashAlgorithm.h.

◆ hashSize()

Int32 Arcane::IHashAlgorithm::hashSize ( ) const
virtual

◆ name()

String Arcane::IHashAlgorithm::name ( ) const
virtual

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