5#ifndef BITCOIN_UTIL_FASTRANGE_H
6#define BITCOIN_UTIL_FASTRANGE_H
28#ifdef __SIZEOF_INT128__
29 return (
static_cast<unsigned __int128>(x) *
30 static_cast<unsigned __int128>(n)) >>
static uint64_t FastRange64(uint64_t x, uint64_t n)
Fast range reduction with 64-bit input and 64-bit range.
static uint32_t FastRange32(uint32_t x, uint32_t n)
This file offers implementations of the fast range reduction technique described in https://lemire....
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...