libxcks
0.1.0.1
|
Computes a hash from a byte stream. More...
#include <checksumex.hpp>
Public Member Functions | |
virtual void | reset ()=0 |
Resets the checksum to initial value. More... | |
std::string | toString (const bool hexInUpperCase=false) const override |
Returns the hash value has a string. More... | |
Public Member Functions inherited from libxcks::Checksum | |
virtual | ~Checksum () |
Destructor. More... | |
virtual uint8_t * | getValue (uint8_t *buffer) const =0 |
Returns the checksum value in the first bytes of the given address. More... | |
virtual size_t | getSize () const =0 |
Returns the minimal size to allocate in memory to store the checksum with the getValue(buffer) method. More... | |
virtual void | update (const uint8_t *buf, size_t len)=0 |
Updates the checksum with specified array of bytes. More... | |
virtual std::string | getName () const =0 |
Returns the name of the checksum or the hash algorithm. More... | |
virtual ArrayString | getAltNames () const |
Returns the alternative name(s) of the checksum or the hash algorithm. More... | |
virtual ChecksumAlgoId | getID () const =0 |
Returns an unique identifier for the checksum or the hash algorithm. More... | |
Static Protected Member Functions | |
static uint32_t | swapOnLE (const uint32_t value) |
Swaps bytes on little endian architectures. More... | |
static uint32_t | swapOnBE (const uint32_t value) |
Swaps bytes on big endian architectures. More... | |
static uint64_t | swapOnLE (const uint64_t value) |
Swaps bytes on little endian architectures. More... | |
static uint64_t | swapOnBE (const uint64_t value) |
Swaps bytes on big endian architectures. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from libxcks::Checksum | |
static ArrayString | getAlternativeNames () |
Returns the alternative name(s) of the checksum or the hash algorithm. More... | |
Computes a hash from a byte stream.
Adds some utilities to the Checksum class.
Definition at line 71 of file checksumex.hpp.
|
pure virtual |
Resets the checksum to initial value.
Implements libxcks::Checksum.
Implemented in libxcks::AbstractSHA512Impl, libxcks::AbstractSHA256Impl, libxcks::LibgcryptHash, libxcks::AbstractKeccakImpl, libxcks::Whirlpool, libxcks::Tiger, libxcks::SM3, libxcks::SHA512, libxcks::SHA384, libxcks::SHA256, libxcks::SHA224, libxcks::SHA1, libxcks::RIPEMD160, libxcks::MD5, libxcks::MD4, libxcks::MD2, libxcks::CRC64, libxcks::CRC32, and libxcks::BLAKE3.
|
inlinestaticprotected |
Swaps bytes on big endian architectures.
value | The value to swap bytes. |
value
on big endian architectures. Definition at line 120 of file checksumex.hpp.
|
inlinestaticprotected |
Swaps bytes on big endian architectures.
value | The value to swap bytes. |
value
on big endian architectures. Definition at line 174 of file checksumex.hpp.
|
inlinestaticprotected |
Swaps bytes on little endian architectures.
value | The value to swap bytes. |
value
on little endian architectures. Definition at line 95 of file checksumex.hpp.
|
inlinestaticprotected |
Swaps bytes on little endian architectures.
value | The value to swap bytes. |
value
on little endian architectures. Definition at line 145 of file checksumex.hpp.
|
overridevirtual |
Returns the hash value has a string.
hexInUpperCase | If true the hexadecimal letters will be in uppercase. |
Implements libxcks::Checksum.
Reimplemented in libxcks::CRC64, and libxcks::CRC32.
Definition at line 42 of file checksumex.cpp.