feat(sha256, baseN): without overloading, just on vector
This commit is contained in:
12
include/base/baseN.hpp
Normal file
12
include/base/baseN.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace baseN
|
||||
{
|
||||
bool isValid(const std::string &str, const int8_t *map) noexcept;
|
||||
std::string encode(std::vector<uint8_t> data, uint8_t base, uint64_t enc_size, const char *digits) noexcept;
|
||||
std::vector<uint8_t> decode(const std::string &str, uint8_t base, uint64_t dec_size, const char *digits, const int8_t *map);
|
||||
}
|
||||
10
include/base/hash/sha256.hpp
Normal file
10
include/base/hash/sha256.hpp
Normal file
@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
#define SHA256_DIGEST_LENGTH 32
|
||||
|
||||
namespace hash {
|
||||
std::vector<uint8_t> sha256(const std::vector<uint8_t> &data);
|
||||
}
|
||||
Reference in New Issue
Block a user