StormByte-Crypto 2.0.0
C++26 cryptography module of the StormByte suite
 
Loading...
Searching...
No Matches
StormByte::Crypto::Hasher::SHA256 Class Referencefinal

SHA-256 hasher. More...

#include <StormByte/crypto/hasher/sha256.hxx>

Inheritance diagram for StormByte::Crypto::Hasher::SHA256:
Collaboration diagram for StormByte::Crypto::Hasher::SHA256:

Public Member Functions

PointerType Clone () const noexcept override
 Clone this hasher.
 
PointerType Move () noexcept override
 Move this hasher into a new instance.
 
Construction
 SHA256 ()
 Default constructor.
 
 SHA256 (const SHA256 &other)=default
 Copy constructor.
 
 SHA256 (SHA256 &&other) noexcept=default
 Move constructor.
 
 ~SHA256 () noexcept
 Destructor.
 
SHA256 & operator= (const SHA256 &other)=default
 Copy assignment.
 
SHA256 & operator= (SHA256 &&other) noexcept=default
 Move assignment.
 
- Public Member Functions inherited from StormByte::Crypto::Hasher::Generic
 Generic (const Generic &other)=default
 Copy constructor.
 
 Generic (Generic &&other) noexcept=default
 Move constructor.
 
virtual ~Generic () noexcept
 Destructor.
 
Generic & operator= (const Generic &other)=default
 Copy assignment.
 
Generic & operator= (Generic &&other) noexcept=default
 Move assignment.
 
bool Hash (std::span< const std::byte > input, Buffer::WriteOnly &output) const noexcept
 Hash a byte span into an output buffer.
 
template<StormByte::Type::ByteInputRange Range>
bool Hash (const Range &input, Buffer::WriteOnly &output) const
 Hash an input range of byte-convertible values.
 
bool Hash (const Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept
 Hash a read-only buffer (copy).
 
bool Hash (Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept
 Hash a buffer, consuming it.
 
Buffer::Consumer Hash (Buffer::Consumer consumer, ReadMode mode=ReadMode::Move) const noexcept
 Hash a Consumer into another Consumer.
 
enum Type Type () const noexcept
 Algorithm of this hasher.
 
- Public Member Functions inherited from StormByte::Safe::Clonable< Generic >
constexpr Clonable ()=default
 
constexpr Clonable (const Clonable &)=default
 
constexpr Clonable (Clonable &&) noexcept=default
 
constexpr Clonable & operator= (const Clonable &)=default
 
constexpr Clonable & operator= (Clonable &&) noexcept=default
 
virtual constexpr ~Clonable () noexcept=default
 

Additional Inherited Members

- Public Types inherited from StormByte::Safe::Clonable< Generic >
typedef SmartPointer PointerType
 
- Static Public Member Functions inherited from StormByte::Safe::Clonable< Generic >
static PointerType MakePointer (Args &&... args)
 
- Protected Member Functions inherited from StormByte::Crypto::Hasher::Generic
 Generic (enum Type type)
 Construct with an algorithm.
 
- Protected Attributes inherited from StormByte::Crypto::Hasher::Generic
enum Type m_type
 Algorithm.
 

Detailed Description

SHA-256 hasher.

Constructor & Destructor Documentation

◆ SHA256() [1/3]

StormByte::Crypto::Hasher::SHA256::SHA256 ( )
inline

Default constructor.

◆ SHA256() [2/3]

StormByte::Crypto::Hasher::SHA256::SHA256 ( const SHA256 &  other)
default

Copy constructor.

Parameters
otherHasher to copy.

◆ SHA256() [3/3]

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

Move constructor.

Parameters
otherHasher to move.

◆ ~SHA256()

StormByte::Crypto::Hasher::SHA256::~SHA256 ( )
noexcept

Destructor.

Member Function Documentation

◆ Clone()

PointerType StormByte::Crypto::Hasher::SHA256::Clone ( ) const
inlineoverridevirtualnoexcept

Clone this hasher.

Returns
Shared pointer to the clone.

Implements StormByte::Safe::Clonable< Generic >.

◆ Move()

PointerType StormByte::Crypto::Hasher::SHA256::Move ( )
inlineoverridevirtualnoexcept

Move this hasher into a new instance.

Returns
Shared pointer to the moved hasher.

Implements StormByte::Safe::Clonable< Generic >.

◆ operator=() [1/2]

Copy assignment.

Parameters
otherHasher to copy.
Returns
Reference to this hasher.

◆ operator=() [2/2]

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

Move assignment.

Parameters
otherHasher to move.
Returns
Reference to this hasher.

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