oc-mint  0.0.1
big_int.hpp
1 #ifndef BIG_INT_HPP
2 #define BIG_INT_HPP
3 
4 #include <string>
5 #include <array>
6 
7 #include "tl/expected.hpp"
8 
9 struct BigInt {
10 
11  BigInt() : data() {}
12  virtual ~BigInt() {}
13 
14  enum class eError : uint8_t { PARSE_ERROR };
15  static tl::expected<BigInt, eError> from_string(const std::string &str);
16 
17  static BigInt from_int(uint64_t value);
18  std::string to_string() const;
19 
20  friend bool operator == (const BigInt& rhs, const BigInt& lhs);
21 private:
22  std::array<uint8_t,256> data;
23 };
24 
25 bool operator==(const BigInt &rhs, const BigInt &lhs);
26 
27 #endif // #ifndef #ifndef BIG_INT_HPP
Definition: big_int.hpp:9