feat(hex): without overloading; fix(sha256): const uint8_t * -> uint8_t *

This commit is contained in:
2024-09-11 16:47:51 +03:00
parent 050efca4cc
commit 17e2e04a3b
5 changed files with 77 additions and 2 deletions

View File

@ -6,6 +6,6 @@
#define SHA256_DIGEST_LENGTH 32
namespace hash {
void sha256(const uint8_t *data, uint64_t data_size, const uint8_t *hash) noexcept;
void sha256(const uint8_t *data, uint64_t data_size, uint8_t *hash) noexcept;
std::vector<uint8_t> sha256(const std::vector<uint8_t> &data) noexcept;
}

12
include/base/hex.hpp Normal file
View File

@ -0,0 +1,12 @@
#pragma once
#include <cstdint>
#include <string>
#include <vector>
namespace hex
{
bool isValid(const std::string &str) noexcept;
std::string encode(const std::vector<uint8_t> &data) noexcept;
std::vector<uint8_t> decode(const std::string &str);
}