Changeset View
Changeset View
Standalone View
Standalone View
src/uint256.h
Show All 12 Lines | |||||
#include <cstring> | #include <cstring> | ||||
#include <stdexcept> | #include <stdexcept> | ||||
#include <string> | #include <string> | ||||
#include <vector> | #include <vector> | ||||
/** Template base class for fixed-sized opaque blobs. */ | /** Template base class for fixed-sized opaque blobs. */ | ||||
template <unsigned int BITS> class base_blob { | template <unsigned int BITS> class base_blob { | ||||
protected: | protected: | ||||
enum { WIDTH = BITS / 8 }; | static constexpr int WIDTH = BITS / 8; | ||||
uint8_t data[WIDTH]; | uint8_t data[WIDTH]; | ||||
public: | public: | ||||
base_blob() { memset(data, 0, sizeof(data)); } | base_blob() { memset(data, 0, sizeof(data)); } | ||||
explicit base_blob(const std::vector<uint8_t> &vch); | explicit base_blob(const std::vector<uint8_t> &vch); | ||||
bool IsNull() const { | bool IsNull() const { | ||||
▲ Show 20 Lines • Show All 144 Lines • Show Last 20 Lines |