StormByte C++ Library: Crypto module 1.0.0
StormByte-Crypto is a StormByte library module for handling cryptographic operations
Loading...
Searching...
No Matches
Public Member Functions | List of all members
StormByte::Crypto::Hasher Class Referencefinal

A class for managing hashing operations. More...

#include <hasher.hxx>

Public Member Functions

 Hasher (const Algorithm::Hash &algorithm) noexcept
 Initializes a Hasher instance with the specified hashing algorithm.
 
 Hasher (const Hasher &hasher)=default
 Copy constructor for the Hasher class.
 
 Hasher (Hasher &&hasher) noexcept=default
 Move constructor for the Hasher class.
 
 ~Hasher () noexcept=default
 Destructor for the Hasher class.
 
Hasheroperator= (const Hasher &hasher)=default
 Copy assignment operator for the Hasher class.
 
Hasheroperator= (Hasher &&hasher) noexcept=default
 Move assignment operator for the Hasher class.
 
Expected< std::string, ExceptionHash (const std::string &input) const noexcept
 Hashes a string input using the specified hashing algorithm.
 
Expected< std::string, ExceptionHash (const Buffer::Simple &buffer) const noexcept
 Hashes a buffer using the specified hashing algorithm.
 
Buffer::Consumer Hash (const Buffer::Consumer consumer) const noexcept
 Hashes data asynchronously using a Consumer/Producer model.
 

Detailed Description

A class for managing hashing operations.

This class provides methods for hashing data using various hashing algorithms.

Constructor & Destructor Documentation

◆ Hasher() [1/3]

StormByte::Crypto::Hasher::Hasher ( const Algorithm::Hash &  algorithm)
explicitnoexcept

Initializes a Hasher instance with the specified hashing algorithm.

Parameters
algorithmThe hashing algorithm to use.

◆ Hasher() [2/3]

StormByte::Crypto::Hasher::Hasher ( const Hasher hasher)
default

Copy constructor for the Hasher class.

Parameters
hasherThe Hasher instance to copy.

◆ Hasher() [3/3]

StormByte::Crypto::Hasher::Hasher ( Hasher &&  hasher)
defaultnoexcept

Move constructor for the Hasher class.

Parameters
hasherThe Hasher instance to move.

Member Function Documentation

◆ Hash() [1/3]

Buffer::Consumer StormByte::Crypto::Hasher::Hash ( const Buffer::Consumer  consumer) const
noexcept

Hashes data asynchronously using a Consumer/Producer model.

Parameters
consumerThe Consumer buffer containing the input data.
Returns
A Consumer buffer containing the hashed data.

◆ Hash() [2/3]

Expected< std::string, Exception > StormByte::Crypto::Hasher::Hash ( const Buffer::Simple &  buffer) const
noexcept

Hashes a buffer using the specified hashing algorithm.

Parameters
bufferThe buffer to hash.
Returns
An Expected containing the hashed string or an error.

◆ Hash() [3/3]

Expected< std::string, Exception > StormByte::Crypto::Hasher::Hash ( const std::string &  input) const
noexcept

Hashes a string input using the specified hashing algorithm.

Parameters
inputThe string to hash.
Returns
An Expected containing the hashed string or an error.

◆ operator=() [1/2]

Hasher & StormByte::Crypto::Hasher::operator= ( const Hasher hasher)
default

Copy assignment operator for the Hasher class.

Parameters
hasherThe Hasher instance to copy.
Returns
A reference to the updated Hasher instance.

◆ operator=() [2/2]

Hasher & StormByte::Crypto::Hasher::operator= ( Hasher &&  hasher)
defaultnoexcept

Move assignment operator for the Hasher class.

Parameters
hasherThe Hasher instance to move.
Returns
A reference to the updated Hasher instance.

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