mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Add FastRandomContext::rand256() and ::randbytes()
FastRandomContext now provides all functionality that the real Rand* functions provide.
This commit is contained in:
@@ -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); }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user