From c21cbe61c6249bcfca098705df6f9b4baab9f296 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 17 Feb 2017 16:32:16 -0800 Subject: Introduce FastRandomContext::randbool() --- src/random.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/random.h') diff --git a/src/random.h b/src/random.h index 0464bdce14..82886bec59 100644 --- a/src/random.h +++ b/src/random.h @@ -42,6 +42,10 @@ public: return (Rw << 16) + Rz; } + bool randbool() { + return rand32() & 1; + } + uint32_t Rz; uint32_t Rw; }; -- cgit v1.2.3