fourdst_plugin 0.0.1a
C++ Plugin Manager
|
Functions | |
std::string | get_openssl_error () |
Retrieves the most recent OpenSSL error messages as a formatted string. | |
std::string | calculate_sha256 (const std::filesystem::path &filepath) |
Calculates the SHA-256 hash of a file's contents. | |
std::string | calculate_sha256_from_buffer (const std::vector< unsigned char > &data) |
Calculates the SHA-256 hash of a binary buffer. | |
std::string fourdst::crypt::utils::calculate_sha256 | ( | const std::filesystem::path & | filepath | ) |
Calculates the SHA-256 hash of a file's contents.
This function reads the contents of the specified file and calculates its SHA-256 hash. The hash is returned as a hexadecimal string.
[in] | filepath | The path to the file to hash. |
std::runtime_error | If the file cannot be opened or read. |
std::runtime_error | If an OpenSSL error occurs during hashing. |
std::string fourdst::crypt::utils::calculate_sha256_from_buffer | ( | const std::vector< unsigned char > & | data | ) |
Calculates the SHA-256 hash of a binary buffer.
This function calculates the SHA-256 hash of the provided binary data buffer and returns the result as a hexadecimal string.
[in] | data | The binary data to hash. |
std::runtime_error | If an OpenSSL error occurs during hashing. |
|
inline |
Retrieves the most recent OpenSSL error messages as a formatted string.
This function retrieves all pending OpenSSL error messages from the error queue and returns them as a single formatted string. Each error is separated by a semicolon.