Kagome
Polkadot Runtime Engine in C++17
mp_utils.hpp File Reference
#include <boost/multiprecision/cpp_int.hpp>
#include <gsl/span>
Include dependency graph for mp_utils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 kagome::common
 

Typedefs

using kagome::common::uint128_t = boost::multiprecision::uint128_t
 
using kagome::common::uint256_t = boost::multiprecision::uint256_t
 

Functions

std::array< uint8_t, 8 > kagome::common::uint64_to_le_bytes (uint64_t number)
 
uint64_t kagome::common::le_bytes_to_uint64 (gsl::span< const uint8_t, 8 > bytes)
 
std::array< uint8_t, 8 > kagome::common::uint64_to_be_bytes (uint64_t number)
 
uint64_t kagome::common::be_bytes_to_uint64 (gsl::span< const uint8_t, 8 > bytes)
 
std::array< uint8_t, 16 > kagome::common::uint128_to_le_bytes (const boost::multiprecision::uint128_t &i)
 
boost::multiprecision::uint128_t kagome::common::le_bytes_to_uint128 (gsl::span< const uint8_t, 16 > bytes)
 
std::array< uint8_t, 16 > kagome::common::uint128_to_be_bytes (const boost::multiprecision::uint128_t &i)
 
boost::multiprecision::uint128_t kagome::common::be_bytes_to_uint128 (gsl::span< const uint8_t, 16 > bytes)
 
std::array< uint8_t, 32 > kagome::common::uint256_to_le_bytes (const boost::multiprecision::uint256_t &i)
 
boost::multiprecision::uint256_t kagome::common::le_bytes_to_uint256 (gsl::span< const uint8_t, 32 > bytes)
 
std::array< uint8_t, 32 > kagome::common::uint256_to_be_bytes (const boost::multiprecision::uint256_t &i)
 
boost::multiprecision::uint256_t kagome::common::be_bytes_to_uint256 (gsl::span< const uint8_t, 32 > bytes)