Bitcoin Core  27.99.0
P2P Digital Currency
Public Types | Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
XoRoShiRo128PlusPlus Class Reference

xoroshiro128++ PRNG. More...

#include <xoroshiro128plusplus.h>

Public Types

using result_type = uint64_t
 

Public Member Functions

constexpr XoRoShiRo128PlusPlus (uint64_t seedval) noexcept
 
 XoRoShiRo128PlusPlus (const XoRoShiRo128PlusPlus &)=delete
 
XoRoShiRo128PlusPlusoperator= (const XoRoShiRo128PlusPlus &)=delete
 
 XoRoShiRo128PlusPlus (XoRoShiRo128PlusPlus &&)=default
 
XoRoShiRo128PlusPlusoperator= (XoRoShiRo128PlusPlus &&)=default
 
 ~XoRoShiRo128PlusPlus ()=default
 
constexpr result_type operator() () noexcept
 

Static Public Member Functions

static constexpr result_type min () noexcept
 
static constexpr result_type max () noexcept
 
static constexpr double entropy () noexcept
 

Static Private Member Functions

constexpr static uint64_t rotl (uint64_t x, int n)
 
constexpr static uint64_t SplitMix64 (uint64_t &seedval) noexcept
 

Private Attributes

uint64_t m_s0
 
uint64_t m_s1
 

Detailed Description

xoroshiro128++ PRNG.

Extremely fast, not appropriate for cryptographic purposes.

Memory footprint is 128bit, period is 2^128 - 1. This class is not thread-safe.

Reference implementation available at https://prng.di.unimi.it/xoroshiro128plusplus.c See https://prng.di.unimi.it/

Definition at line 19 of file xoroshiro128plusplus.h.

Member Typedef Documentation

◆ result_type

Definition at line 38 of file xoroshiro128plusplus.h.

Constructor & Destructor Documentation

◆ XoRoShiRo128PlusPlus() [1/3]

constexpr XoRoShiRo128PlusPlus::XoRoShiRo128PlusPlus ( uint64_t  seedval)
inlineexplicitconstexprnoexcept

Definition at line 40 of file xoroshiro128plusplus.h.

◆ XoRoShiRo128PlusPlus() [2/3]

XoRoShiRo128PlusPlus::XoRoShiRo128PlusPlus ( const XoRoShiRo128PlusPlus )
delete

◆ XoRoShiRo128PlusPlus() [3/3]

XoRoShiRo128PlusPlus::XoRoShiRo128PlusPlus ( XoRoShiRo128PlusPlus &&  )
default

◆ ~XoRoShiRo128PlusPlus()

XoRoShiRo128PlusPlus::~XoRoShiRo128PlusPlus ( )
default

Member Function Documentation

◆ entropy()

static constexpr double XoRoShiRo128PlusPlus::entropy ( )
inlinestaticconstexprnoexcept

Definition at line 68 of file xoroshiro128plusplus.h.

◆ max()

static constexpr result_type XoRoShiRo128PlusPlus::max ( )
inlinestaticconstexprnoexcept

Definition at line 67 of file xoroshiro128plusplus.h.

◆ min()

static constexpr result_type XoRoShiRo128PlusPlus::min ( )
inlinestaticconstexprnoexcept

Definition at line 66 of file xoroshiro128plusplus.h.

◆ operator()()

constexpr result_type XoRoShiRo128PlusPlus::operator() ( )
inlineconstexprnoexcept

Definition at line 56 of file xoroshiro128plusplus.h.

Here is the call graph for this function:

◆ operator=() [1/2]

XoRoShiRo128PlusPlus& XoRoShiRo128PlusPlus::operator= ( const XoRoShiRo128PlusPlus )
delete

◆ operator=() [2/2]

XoRoShiRo128PlusPlus& XoRoShiRo128PlusPlus::operator= ( XoRoShiRo128PlusPlus &&  )
default

◆ rotl()

constexpr static uint64_t XoRoShiRo128PlusPlus::rotl ( uint64_t  x,
int  n 
)
inlinestaticconstexprprivate

Definition at line 24 of file xoroshiro128plusplus.h.

Here is the caller graph for this function:

◆ SplitMix64()

constexpr static uint64_t XoRoShiRo128PlusPlus::SplitMix64 ( uint64_t &  seedval)
inlinestaticconstexprprivatenoexcept

Definition at line 29 of file xoroshiro128plusplus.h.

Member Data Documentation

◆ m_s0

uint64_t XoRoShiRo128PlusPlus::m_s0
private

Definition at line 21 of file xoroshiro128plusplus.h.

◆ m_s1

uint64_t XoRoShiRo128PlusPlus::m_s1
private

Definition at line 22 of file xoroshiro128plusplus.h.


The documentation for this class was generated from the following file: