ObsidianDragon - DragonX ImGui Wallet
Full-node GUI wallet for DragonX cryptocurrency. Built with Dear ImGui, SDL3, and OpenGL3/DX11. Features: - Send/receive shielded and transparent transactions - Autoshield with merged transaction display - Built-in CPU mining (xmrig) - Peer management and network monitoring - Wallet encryption with PIN lock - QR code generation for receive addresses - Transaction history with pagination - Console for direct RPC commands - Cross-platform (Linux, Windows)
This commit is contained in:
53
src/util/base64.h
Normal file
53
src/util/base64.h
Normal file
@@ -0,0 +1,53 @@
|
||||
// DragonX Wallet - ImGui Edition
|
||||
// Copyright 2024-2026 The Hush Developers
|
||||
// Released under the GPLv3
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
|
||||
namespace dragonx {
|
||||
namespace util {
|
||||
|
||||
/**
|
||||
* @brief Base64 encoding/decoding utilities
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Encode binary data to base64 string
|
||||
* @param data Input data
|
||||
* @param len Length of input data
|
||||
* @return Base64 encoded string
|
||||
*/
|
||||
std::string base64_encode(const unsigned char* data, size_t len);
|
||||
|
||||
/**
|
||||
* @brief Encode string to base64
|
||||
* @param input Input string
|
||||
* @return Base64 encoded string
|
||||
*/
|
||||
inline std::string base64_encode(const std::string& input) {
|
||||
return base64_encode(reinterpret_cast<const unsigned char*>(input.data()), input.size());
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Decode base64 string to binary data
|
||||
* @param encoded Base64 encoded string
|
||||
* @return Decoded binary data
|
||||
*/
|
||||
std::vector<unsigned char> base64_decode(const std::string& encoded);
|
||||
|
||||
/**
|
||||
* @brief Decode base64 string to string
|
||||
* @param encoded Base64 encoded string
|
||||
* @return Decoded string
|
||||
*/
|
||||
inline std::string base64_decode_string(const std::string& encoded) {
|
||||
auto decoded = base64_decode(encoded);
|
||||
return std::string(decoded.begin(), decoded.end());
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
} // namespace dragonx
|
||||
Reference in New Issue
Block a user