fix(sha256): define DIGEST_LENGTH removed

This commit is contained in:
2024-09-22 21:02:23 +03:00
parent b61d8396f5
commit f6e17b4f7b
2 changed files with 3 additions and 4 deletions

View File

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

View File

@ -174,7 +174,7 @@ namespace hash
}
std::vector<uint8_t> sha256(std::span<const uint8_t> data) noexcept
{
std::vector<uint8_t> hash(SHA256_DIGEST_LENGTH);
std::vector<uint8_t> hash(32);
sha256(data.data(), data.size(), hash.data());
return hash;
}