File tree Expand file tree Collapse file tree 2 files changed +12
-19
lines changed Expand file tree Collapse file tree 2 files changed +12
-19
lines changed Original file line number Diff line number Diff line change @@ -659,23 +659,6 @@ void FastRandomContext::RandomSeed()
659
659
requires_seed = false ;
660
660
}
661
661
662
- uint256 FastRandomContext::rand256 () noexcept
663
- {
664
- uint256 ret;
665
- fillrand (MakeWritableByteSpan (ret));
666
- return ret;
667
- }
668
-
669
- template <typename B>
670
- std::vector<B> FastRandomContext::randbytes (size_t len)
671
- {
672
- std::vector<B> ret (len);
673
- fillrand (MakeWritableByteSpan (ret));
674
- return ret;
675
- }
676
- template std::vector<unsigned char > FastRandomContext::randbytes (size_t );
677
- template std::vector<std::byte> FastRandomContext::randbytes (size_t );
678
-
679
662
void FastRandomContext::fillrand (Span<std::byte> output)
680
663
{
681
664
if (requires_seed) RandomSeed ();
Original file line number Diff line number Diff line change @@ -213,7 +213,12 @@ class FastRandomContext
213
213
214
214
/* * Generate random bytes. */
215
215
template <typename B = unsigned char >
216
- std::vector<B> randbytes (size_t len);
216
+ std::vector<B> randbytes (size_t len)
217
+ {
218
+ std::vector<B> ret (len);
219
+ fillrand (MakeWritableByteSpan (ret));
220
+ return ret;
221
+ }
217
222
218
223
/* * Fill a byte Span with random bytes. */
219
224
void fillrand (Span<std::byte> output);
@@ -222,7 +227,12 @@ class FastRandomContext
222
227
uint32_t rand32 () noexcept { return randbits (32 ); }
223
228
224
229
/* * generate a random uint256. */
225
- uint256 rand256 () noexcept ;
230
+ uint256 rand256 () noexcept
231
+ {
232
+ uint256 ret;
233
+ fillrand (MakeWritableByteSpan (ret));
234
+ return ret;
235
+ }
226
236
227
237
/* * Generate a random boolean. */
228
238
bool randbool () noexcept { return randbits (1 ); }
You can’t perform that action at this time.
0 commit comments