SHA256
高精度改为vector
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define BETTERSTL_BIG_INTEGER_HPP
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
namespace bstl {
|
||||
@@ -55,15 +56,15 @@ public:
|
||||
BigInteger operator/(const BigInteger& other) const;
|
||||
|
||||
private:
|
||||
std::string m_digits; // 无符号数字,从高位到低位
|
||||
int m_sign; // -1, 0, 1
|
||||
std::vector<int> m_digits; // 无符号数字,低位在前
|
||||
int m_sign; // -1, 0, 1
|
||||
|
||||
static std::string m_trimLeadingZeros(const std::string& value);
|
||||
static int m_compareAbs(const std::string& a, const std::string& b);
|
||||
static std::string m_addAbs(const std::string& a, const std::string& b);
|
||||
static std::string m_subAbs(const std::string& a, const std::string& b);
|
||||
static std::string m_mulAbs(const std::string& a, const std::string& b);
|
||||
static std::string divAbs(const std::string& a, const std::string& b);
|
||||
static std::vector<int> m_trimLeadingZeros(const std::vector<int>& value);
|
||||
static int m_compareAbs(const std::vector<int>& a, const std::vector<int>& b);
|
||||
static std::vector<int> m_addAbs(const std::vector<int>& a, const std::vector<int>& b);
|
||||
static std::vector<int> m_subAbs(const std::vector<int>& a, const std::vector<int>& b);
|
||||
static std::vector<int> m_mulAbs(const std::vector<int>& a, const std::vector<int>& b);
|
||||
static std::vector<int> m_divAbs(const std::vector<int>& a, const std::vector<int>& b);
|
||||
};
|
||||
|
||||
// 流运算符重载
|
||||
|
||||
Reference in New Issue
Block a user