Skip to content

intx::be

Namespaces

Name
intx:🇧🇪:unsafe

Functions

Name
template <typename IntT ,unsigned M>
IntT
load(const uint8_t(&) bytes[M])
template <typename IntT ,typename T >
IntT
load(const T & t)
template <unsigned N>
void
store(uint8_t(&) dst[N/8], const intx::uint< N > & x)
Stores an uint value in a bytes array in big-endian order.
template <typename T ,unsigned N>
T
store(const intx::uint< N > & x)
template <unsigned M,unsigned N>
void
trunc(uint8_t(&) dst[M], const intx::uint< N > & x)
template <typename T ,unsigned N>
T
trunc(const intx::uint< N > & x)
Stores the truncated value of an uint in the .bytes field of an object of type T.

Functions Documentation

function load

template <typename IntT ,
unsigned M>
inline IntT load(
    const uint8_t(&) bytes[M]
)

Loads an uint value from bytes of big-endian order. If the size of bytes is smaller than the result uint, the value is zero-extended.

function load

template <typename IntT ,
typename T >
inline IntT load(
    const T & t
)

function store

template <unsigned N>
inline void store(
    uint8_t(&) dst[N/8],
    const intx::uint< N > & x
)

Stores an uint value in a bytes array in big-endian order.

function store

template <typename T ,
unsigned N>
inline T store(
    const intx::uint< N > & x
)

Stores an uint value in .bytes field of type T. The .bytes must be an array of uint8_t of the size matching the size of uint.

function trunc

template <unsigned M,
unsigned N>
inline void trunc(
    uint8_t(&) dst[M],
    const intx::uint< N > & x
)

Stores the truncated value of an uint in a bytes array. Only the least significant bytes from big-endian representation of the uint are stored in the result bytes array up to array's size.

function trunc

template <typename T ,
unsigned N>
inline T trunc(
    const intx::uint< N > & x
)

Stores the truncated value of an uint in the .bytes field of an object of type T.


Updated on 2026-04-13 at 23:22:46 -0700