progminer zano miner fork https://github.com/hyle-team/progminer
This commit is contained in:
51
zano/libdevcore/Common.h
Normal file
51
zano/libdevcore/Common.h
Normal file
@@ -0,0 +1,51 @@
|
||||
// progminer -- Ethereum miner with OpenCL, CUDA and stratum support.
|
||||
// Copyright 2018 progminer Authors.
|
||||
// Licensed under GNU General Public License, Version 3. See the LICENSE file.
|
||||
|
||||
/// @file
|
||||
/// Very common stuff (i.e. that every other header needs except vector_ref.h).
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "vector_ref.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/multiprecision/cpp_int.hpp>
|
||||
|
||||
using byte = uint8_t;
|
||||
|
||||
namespace dev
|
||||
{
|
||||
// Binary data types.
|
||||
using bytes = std::vector<byte>;
|
||||
using bytesRef = vector_ref<byte>;
|
||||
using bytesConstRef = vector_ref<byte const>;
|
||||
|
||||
// Numeric types.
|
||||
using bigint = boost::multiprecision::number<boost::multiprecision::cpp_int_backend<>>;
|
||||
using u64 = boost::multiprecision::number<boost::multiprecision::cpp_int_backend<64, 64,
|
||||
boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>>;
|
||||
using u128 = boost::multiprecision::number<boost::multiprecision::cpp_int_backend<128, 128,
|
||||
boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>>;
|
||||
using u256 = boost::multiprecision::number<boost::multiprecision::cpp_int_backend<256, 256,
|
||||
boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>>;
|
||||
using u160 = boost::multiprecision::number<boost::multiprecision::cpp_int_backend<160, 160,
|
||||
boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>>;
|
||||
using u512 = boost::multiprecision::number<boost::multiprecision::cpp_int_backend<512, 512,
|
||||
boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>>;
|
||||
|
||||
// Null/Invalid values for convenience.
|
||||
static const u256 Invalid256 = ~(u256)0;
|
||||
|
||||
/// Converts arbitrary value to string representation using std::stringstream.
|
||||
template <class _T>
|
||||
std::string toString(_T const& _t)
|
||||
{
|
||||
std::ostringstream o;
|
||||
o << _t;
|
||||
return o.str();
|
||||
}
|
||||
|
||||
} // namespace dev
|
Reference in New Issue
Block a user