SVCS - English Documentation
Loading...
Searching...
No Matches
Utils.hxx
Go to the documentation of this file.
1
13#pragma once
14
15#include <filesystem>
16#include <string>
17
31namespace svcs::core {
32
33namespace fs = std::filesystem;
34
54std::string read_file_to_string(const fs::path& full_path);
55
69std::string binary_to_hex_string(const unsigned char* binary_data, size_t length);
70
84std::string hex_to_binary_string(const std::string& hex_string);
85
97std::string compute_sha256(const std::string& input);
98
99}
Core VCS data structures and object model.
std::string compute_sha256(const std::string &input)
Computes the SHA-256 hash of the given input data.
std::string read_file_to_string(const fs::path &full_path)
Reads the entire content of a file into a single std::string.
Definition Utils.cxx:18
std::string hex_to_binary_string(const std::string &hex_string)
Converts a hexadecimal string (e.g., 40 chars) into its raw binary byte representation (e....
Definition Utils.cxx:45
std::string binary_to_hex_string(const unsigned char *binary_data, size_t length)
Converts a binary buffer (e.g., a raw SHA-1 hash) into its hexadecimal string representation.
Definition Utils.cxx:36