5#ifndef BITCOIN_COMPAT_ENDIAN_H
6#define BITCOIN_COMPAT_ENDIAN_H
8#if defined(HAVE_CONFIG_H)
9#include <config/bitcoin-config.h>
16#if defined(HAVE_ENDIAN_H)
18#elif defined(HAVE_SYS_ENDIAN_H)
19#include <sys/endian.h>
27#define HAVE_DECL_HTOBE16 1
30#define HAVE_DECL_HTOLE16 1
33#define HAVE_DECL_BE16TOH 1
36#define HAVE_DECL_LE16TOH 1
40#define HAVE_DECL_HTOBE32 1
43#define HAVE_DECL_HTOLE32 1
46#define HAVE_DECL_BE32TOH 1
49#define HAVE_DECL_LE32TOH 1
53#define HAVE_DECL_HTOBE64 1
56#define HAVE_DECL_HTOLE64 1
59#define HAVE_DECL_BE64TOH 1
62#define HAVE_DECL_LE64TOH 1
67#if defined(WORDS_BIGENDIAN)
69#if HAVE_DECL_HTOBE16 == 0
75#if HAVE_DECL_HTOLE16 == 0
81#if HAVE_DECL_BE16TOH == 0
87#if HAVE_DECL_LE16TOH == 0
93#if HAVE_DECL_HTOBE32 == 0
99#if HAVE_DECL_HTOLE32 == 0
105#if HAVE_DECL_BE32TOH == 0
111#if HAVE_DECL_LE32TOH == 0
117#if HAVE_DECL_HTOBE64 == 0
123#if HAVE_DECL_HTOLE64 == 0
129#if HAVE_DECL_BE64TOH == 0
135#if HAVE_DECL_LE64TOH == 0
143#if HAVE_DECL_HTOBE16 == 0
149#if HAVE_DECL_HTOLE16 == 0
155#if HAVE_DECL_BE16TOH == 0
161#if HAVE_DECL_LE16TOH == 0
167#if HAVE_DECL_HTOBE32 == 0
173#if HAVE_DECL_HTOLE32 == 0
179#if HAVE_DECL_BE32TOH == 0
185#if HAVE_DECL_LE32TOH == 0
191#if HAVE_DECL_HTOBE64 == 0
197#if HAVE_DECL_HTOLE64 == 0
203#if HAVE_DECL_BE64TOH == 0
209#if HAVE_DECL_LE64TOH == 0
uint16_t bswap_16(uint16_t x)
uint64_t bswap_64(uint64_t x)
uint32_t bswap_32(uint32_t x)
uint16_t be16toh(uint16_t big_endian_16bits)
uint16_t htobe16(uint16_t host_16bits)
uint32_t le32toh(uint32_t little_endian_32bits)
uint32_t htobe32(uint32_t host_32bits)
uint16_t le16toh(uint16_t little_endian_16bits)
uint64_t htobe64(uint64_t host_64bits)
uint64_t be64toh(uint64_t big_endian_64bits)
uint32_t be32toh(uint32_t big_endian_32bits)
uint64_t htole64(uint64_t host_64bits)
uint32_t htole32(uint32_t host_32bits)
uint16_t htole16(uint16_t host_16bits)
uint64_t le64toh(uint64_t little_endian_64bits)
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...