aboutsummaryrefslogtreecommitdiff
path: root/src/random.h
diff options
context:
space:
mode:
authorpasta <pasta@dashboost.org>2022-10-19 15:16:04 -0500
committerpasta <pasta@dashboost.org>2022-12-10 14:34:44 -0600
commit935acdcc79d1dc5ac04a83b92e5919ddbfa29329 (patch)
treed38d0afc26dd7d85a346a676d6ab93ca2e7a6fba /src/random.h
parent1ea02791f3d81c7716d9ea455971203f74d7a107 (diff)
downloadbitcoin-935acdcc79d1dc5ac04a83b92e5919ddbfa29329.tar.xz
refactor: modernize the implementation of uint256.*
- Constructors of uint256 to utilize Span instead of requiring a std::vector - converts m_data into a std::array - Prefers using `WIDTH` instead of `sizeof(m_data)` - make all the things constexpr - replace C style functions with c++ equivalents - memset -> std::fill - memcpy -> std::copy Note: In practice, implementations of std::copy avoid multiple assignments and use bulk copy functions such as std::memmove if the value type is TriviallyCopyable and the iterator types satisfy LegacyContiguousIterator. (https://en.cppreference.com/w/cpp/algorithm/copy) - memcmp -> std::memcmp
Diffstat (limited to 'src/random.h')
-rw-r--r--src/random.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/random.h b/src/random.h
index 5fe20c5f76..082ccd4047 100644
--- a/src/random.h
+++ b/src/random.h
@@ -15,6 +15,7 @@
#include <chrono>
#include <cstdint>
#include <limits>
+#include <vector>
/**
* Overall design of the RNG and entropy sources.