libxcks
0.1.0.1
|
Computes a checksum from a byte stream. More...
#include <checksum.hpp>
Public Member Functions | |
virtual | ~Checksum () |
Destructor. More... | |
virtual void | reset ()=0 |
Resets the checksum to initial value. More... | |
virtual std::string | toString (const bool hexInUpperCase=false) const =0 |
Returns the checksum value in a string. 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 Public Member Functions | |
static ArrayString | getAlternativeNames () |
Returns the alternative name(s) of the checksum or the hash algorithm. More... | |
Computes a checksum from a byte stream.
Using this class in very simple:
Use the update method to provide to the class the bytes for computing the checksum.
The checksum value can be gotten by the toString method which puts the checksum value in a string or getValue to get an array of bytes.
The checksum computing can be reseted by the reset method.
Definition at line 53 of file checksum.hpp.
|
inlinevirtual |
Destructor.
Definition at line 59 of file checksum.hpp.
|
inlinestatic |
Returns the alternative name(s) of the checksum or the hash algorithm.
Definition at line 137 of file checksum.hpp.
|
inlinevirtual |
Returns the alternative name(s) of the checksum or the hash algorithm.
Reimplemented in libxcks::SHA3_512, libxcks::SHA3_384, libxcks::SHA3_256, libxcks::SHA3_224, libxcks::SHA512, libxcks::SHA384, libxcks::SHA256, libxcks::SHA224, libxcks::SHA1, libxcks::CRC64, libxcks::CRC32, and libxcks::RIPEMD160.
Definition at line 116 of file checksum.hpp.
|
pure virtual |
Returns an unique identifier for the checksum or the hash algorithm.
Implemented in libxcks::SHA3_512, libxcks::SHA3_384, libxcks::SHA3_256, libxcks::SHA3_224, 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.
|
pure virtual |
Returns the name of the checksum or the hash algorithm.
Implemented in libxcks::SHA3_512, libxcks::SHA3_384, libxcks::SHA3_256, libxcks::SHA3_224, 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.
|
pure virtual |
Returns the minimal size to allocate in memory to store the checksum with the getValue(buffer) method.
Implemented in libxcks::SHA3_512, libxcks::SHA3_384, libxcks::SHA3_256, libxcks::SHA3_224, 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.
|
pure virtual |
Returns the checksum value in the first bytes of the given address.
buffer | The buffer where the checksum value will be stored. |
Implemented in libxcks::SHA3_512, libxcks::SHA3_384, 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::SHA3_256, libxcks::SHA3_224, libxcks::CRC64, libxcks::CRC32, and libxcks::BLAKE3.
|
pure virtual |
Resets the checksum to initial value.
Implemented in libxcks::ChecksumEx, 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.
|
pure virtual |
Returns the checksum value in a string.
hexInUpperCase | If true the hexadecimal letters will be in uppercase. |
Implemented in libxcks::CRC64, libxcks::CRC32, and libxcks::ChecksumEx.
|
pure virtual |
Updates the checksum with specified array of bytes.
buf | The byte array to update the checksum with. |
len | The number of bytes to use for the update. |
Implemented in libxcks::AbstractSHA512Impl, libxcks::AbstractSHA256Impl, libxcks::AbstractKeccakImpl, libxcks::Whirlpool, libxcks::Tiger, libxcks::SM3, libxcks::SHA1, libxcks::RIPEMD160, libxcks::MD5, libxcks::MD4, libxcks::MD2, libxcks::CRC64, libxcks::CRC32, and libxcks::BLAKE3.