mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-27 17:10:46 +00:00
16 lines
318 B
C++
16 lines
318 B
C++
#include <xrpl/crypto/csprng.h>
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
using namespace xrpl;
|
|
|
|
TEST(csprng, get_values)
|
|
{
|
|
auto& engine = crypto_prng();
|
|
auto rand_val = engine();
|
|
EXPECT_GE(rand_val, engine.min());
|
|
EXPECT_LE(rand_val, engine.max());
|
|
uint16_t twoByte{0};
|
|
engine(&twoByte, sizeof(uint16_t));
|
|
}
|