veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
base58.hpp
1// Copyright (c) 2019-2022 Xenios SEZC
2// https://www.veriblock.org
3// Distributed under the MIT software license, see the accompanying
4// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
5
6#ifndef ALT_INTEGRATION_VERIBLOCK_BASE58_HPP
7#define ALT_INTEGRATION_VERIBLOCK_BASE58_HPP
8
9#include <string>
10#include <vector>
11#include <veriblock/pop/validation_state.hpp>
12
13namespace altintegration {
14
16std::string EncodeBase58(const unsigned char *pbegin,
17 const unsigned char *pend);
18
20template <typename T,
21 typename = typename std::enable_if<sizeof(typename T::value_type) ==
22 1>::type>
23std::string EncodeBase58(const T &container) {
24 const uint8_t *ptr = container.data();
25 return EncodeBase58(ptr, ptr + container.size());
26}
27
29bool DecodeBase58(const std::string &str,
30 std::vector<unsigned char> &out,
31 ValidationState &state);
32
33} // namespace altintegration
34
35#endif
Class that is used for storing validation state.
Defines logging helpers.
Definition: block.hpp:14
std::string EncodeBase58(const unsigned char *pbegin, const unsigned char *pend)
Encodes input bytes to Base58.
bool DecodeBase58(const std::string &str, std::vector< unsigned char > &out, ValidationState &state)
Decodes base58 into bytes.