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

A generic hasher class. More...

#include <generic.hxx>

Inheritance diagram for StormByte::Crypto::Hasher::Generic:
Inheritance graph
[legend]
Collaboration diagram for StormByte::Crypto::Hasher::Generic:
Collaboration graph
[legend]

Public Member Functions

 Generic (const Generic &other)=default
 Copy constructor.
 
 Generic (Generic &&other) noexcept=default
 Move constructor.
 
virtual ~Generic () noexcept=default
 Virtual destructor.
 
Genericoperator= (const Generic &other)=default
 Copy assignment operator.
 
Genericoperator= (Generic &&other) noexcept=default
 Move assignment operator.
 
bool Hash (std::span< const std::byte > input, Buffer::WriteOnly &output) const noexcept
 Hash data from input buffer to output buffer.
 
bool Hash (const Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept
 Hash data from input buffer to output buffer.
 
bool Hash (Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept
 Hash data from input buffer to output buffer, moving the input data.
 
Buffer::Consumer Hash (Buffer::Consumer consumer, ReadMode mode=ReadMode::Move) const noexcept
 Hash data from a Consumer buffer.
 
enum Type Type () const noexcept
 Gets the type of hasher.
 

Protected Member Functions

 Generic (enum Type type)
 Constructor.
 

Protected Attributes

enum Type m_type
 The type of hasher.
 

Detailed Description

A generic hasher class.

Constructor & Destructor Documentation

◆ Generic() [1/3]

StormByte::Crypto::Hasher::Generic::Generic ( const Generic other)
default

Copy constructor.

Parameters
otherThe other Generic hasher to copy from.

◆ Generic() [2/3]

StormByte::Crypto::Hasher::Generic::Generic ( Generic &&  other)
defaultnoexcept

Move constructor.

Parameters
otherThe other Generic hasher to move from.

◆ Generic() [3/3]

StormByte::Crypto::Hasher::Generic::Generic ( enum Type  type)
inlineprotected

Constructor.

Parameters
typeThe type of hasher.

Member Function Documentation

◆ Hash() [1/4]

Buffer::Consumer StormByte::Crypto::Hasher::Generic::Hash ( Buffer::Consumer  consumer,
ReadMode  mode = ReadMode::Move 
) const
inlinenoexcept

Hash data from a Consumer buffer.

Parameters
consumerThe Consumer buffer to hash.
modeThe read mode indicating copy or move.
Returns
A Consumer buffer containing the hashed data.

◆ Hash() [2/4]

bool StormByte::Crypto::Hasher::Generic::Hash ( Buffer::ReadOnly &  input,
Buffer::WriteOnly &  output 
) const
inlinenoexcept

Hash data from input buffer to output buffer, moving the input data.

Parameters
inputThe input buffer to hash.
outputThe output buffer to write the hashed data to.
Returns
true if hashing was successful, false otherwise.

◆ Hash() [3/4]

bool StormByte::Crypto::Hasher::Generic::Hash ( const Buffer::ReadOnly &  input,
Buffer::WriteOnly &  output 
) const
inlinenoexcept

Hash data from input buffer to output buffer.

Parameters
inputThe input buffer to hash.
outputThe output buffer to write the hashed data to.
Returns
true if hashing was successful, false otherwise.

◆ Hash() [4/4]

bool StormByte::Crypto::Hasher::Generic::Hash ( std::span< const std::byte >  input,
Buffer::WriteOnly &  output 
) const
inlinenoexcept

Hash data from input buffer to output buffer.

Parameters
inputThe input buffer to hash.
outputThe output buffer to write the hashed data to.
Returns
true if hashing was successful, false otherwise.

◆ operator=() [1/2]

Generic & StormByte::Crypto::Hasher::Generic::operator= ( const Generic other)
default

Copy assignment operator.

Parameters
otherThe other Generic hasher to copy from.
Returns
Reference to this Generic hasher.

◆ operator=() [2/2]

Generic & StormByte::Crypto::Hasher::Generic::operator= ( Generic &&  other)
defaultnoexcept

Move assignment operator.

Parameters
otherThe other Generic hasher to move from.
Returns
Reference to this Generic hasher.

◆ Type()

enum Type StormByte::Crypto::Hasher::Generic::Type ( ) const
inlinenoexcept

Gets the type of hasher.

Returns
The type of hasher.

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