Implemented and tested Base_X_2_Y

This commit is contained in:
Leonetienne
2022-02-27 16:55:18 +01:00
parent 88d78a472b
commit 932bd62477
4 changed files with 173 additions and 2 deletions

View File

@@ -29,6 +29,14 @@ public:
//! \return A 64-bit integer representing the number
static std::uint64_t BaseX_2_10(const std::string& num, const std::string& set);
//! Will convert a number from an arbitrary base to another arbitrary base.
//! \param num A string representation of a number
//! \param set_in The set/base of the input
//! \param set_out The desired set/base to output
//! \param minLen The minimum output length. Setting this will result in zero-padded output (Like, 00000001 instead of 1)
//! \return `num` in base `set_out`
static std::string BaseX_2_Y(const std::string& num, const std::string& set_in, const std::string& set_out, const std::uint32_t minLen = 1);
private:
// No instantiation! >:(
GeneralUtility();