|
Lightweight 0.20260303.0
|
Simple SHA-256 implementation for backup integrity verification. More...
#include <Sha256.hpp>
Public Member Functions | |
| void | Reset () |
| Resets the hash state to initial values. | |
| void | Update (void const *data, size_t len) |
| Updates the hash with the given data. | |
| void | Update (std::span< uint8_t const > data) |
| Updates the hash with the given data span. | |
| void | Update (std::string_view data) |
| Updates the hash with the given string data. | |
| std::array< uint8_t, DigestSize > | Finalize () |
| Finalizes the hash computation and returns the digest. | |
Static Public Member Functions | |
| static std::string | ToHex (std::array< uint8_t, DigestSize > const &digest) |
| Converts a digest to its hexadecimal string representation. | |
| static std::string | Hash (void const *data, size_t len) |
| Computes the SHA-256 hash of the given data and returns it as a hex string. | |
| static std::string | Hash (std::string_view data) |
| Computes the SHA-256 hash of the given string and returns it as a hex string. | |
Static Public Attributes | |
| static constexpr size_t | DigestSize = 32 |
| The size of the SHA-256 digest in bytes. | |
| static constexpr size_t | BlockSize = 64 |
| The block size used by the SHA-256 algorithm in bytes. | |
Simple SHA-256 implementation for backup integrity verification.
Definition at line 17 of file Sha256.hpp.
|
inline |
Definition at line 25 of file Sha256.hpp.
|
inline |
Resets the hash state to initial values.
Definition at line 31 of file Sha256.hpp.
|
inline |
Updates the hash with the given data.
Definition at line 46 of file Sha256.hpp.
References BlockSize.
Referenced by Finalize(), Hash(), Update(), and Update().
|
inline |
Updates the hash with the given data span.
Definition at line 81 of file Sha256.hpp.
References Update().
|
inline |
Updates the hash with the given string data.
Definition at line 87 of file Sha256.hpp.
References Update().
|
inline |
Finalizes the hash computation and returns the digest.
Definition at line 93 of file Sha256.hpp.
References Update().
Referenced by Hash().
|
inlinestatic |
Converts a digest to its hexadecimal string representation.
Definition at line 126 of file Sha256.hpp.
Referenced by Hash().
|
inlinestatic |
Computes the SHA-256 hash of the given data and returns it as a hex string.
Definition at line 135 of file Sha256.hpp.
References Finalize(), ToHex(), and Update().
Referenced by Hash().
|
inlinestatic |
Computes the SHA-256 hash of the given string and returns it as a hex string.
Definition at line 143 of file Sha256.hpp.
References Hash().
|
staticconstexpr |
The size of the SHA-256 digest in bytes.
Definition at line 21 of file Sha256.hpp.
|
staticconstexpr |
The block size used by the SHA-256 algorithm in bytes.
Definition at line 23 of file Sha256.hpp.
Referenced by Update().