oc-issuer  0.0.2
big_int.hpp
1 #ifndef OC_ISSUER_BIG_INT_HPP
2 #define OC_ISSUER_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() = default;
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  [[nodiscard]] std::string to_string() const;
19 
20  friend bool operator == (const BigInt& rhs, const BigInt& lhs);
21 private:
22  std::array<uint8_t,256U> data;
23 };
24 
25 bool operator==(const BigInt &rhs, const BigInt &lhs);
26 
27 #endif // #ifndef #ifndef OC_ISSUER_BIG_INT_HPP
Definition: big_int.hpp:9