aboutsummaryrefslogtreecommitdiff
path: root/src/random.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-05-02 11:04:31 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-06-05 12:44:44 -0700
commit37e864eb9fee4b592bd61c5ec3555b00a2de2cf7 (patch)
tree901f97994d5a2e5aebf5f3e41d27698b780ac152 /src/random.h
parent9fec4da0bec93a49798b5f5e92cf76e900759ee4 (diff)
downloadbitcoin-37e864eb9fee4b592bd61c5ec3555b00a2de2cf7.tar.xz
Add FastRandomContext::rand256() and ::randbytes()
FastRandomContext now provides all functionality that the real Rand* functions provide.
Diffstat (limited to 'src/random.h')
-rw-r--r--src/random.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/random.h b/src/random.h
index 6a63d57429..dcb74eadb5 100644
--- a/src/random.h
+++ b/src/random.h
@@ -110,9 +110,15 @@ public:
}
}
+ /** Generate random bytes. */
+ std::vector<unsigned char> randbytes(size_t len);
+
/** Generate a random 32-bit integer. */
uint32_t rand32() { return randbits(32); }
+ /** generate a random uint256. */
+ uint256 rand256();
+
/** Generate a random boolean. */
bool randbool() { return randbits(1); }
};