Initial commit: PrivateBin API C++ DLL implementation
This commit is contained in:
30
include/base58.h
Normal file
30
include/base58.h
Normal file
@ -0,0 +1,30 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user