30 lines
622 B
C++
30 lines
622 B
C++
#ifndef BASE58_H
|
|
#define BASE58_H
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class Base58 {
|
|
public:
|
|
/**
|
|
* Encodes data using Base58
|
|
*
|
|
* @param data The data to encode
|
|
* @return The Base58 encoded string
|
|
*/
|
|
static std::string encode(const std::vector<unsigned char>& data);
|
|
|
|
/**
|
|
* Decodes a Base58 string
|
|
*
|
|
* @param encoded The Base58 encoded string
|
|
* @return The decoded data
|
|
*/
|
|
static std::vector<unsigned char> decode(const std::string& encoded);
|
|
|
|
private:
|
|
static const std::string ALPHABET;
|
|
static const int BASE58_BASE = 58;
|
|
};
|
|
|
|
#endif // BASE58_H
|