|
rippled
|
Integers of any length that is a multiple of 32-bits. More...
#include <base_uint.h>

Classes | |
| struct | VoidHelper |
| Construct from a raw pointer. More... | |
Public Types | |
| using | size_type = std::size_t |
| using | difference_type = std::ptrdiff_t |
| using | value_type = unsigned char |
| using | pointer = value_type * |
| using | reference = value_type & |
| using | const_pointer = value_type const * |
| using | const_reference = value_type const & |
| using | iterator = pointer |
| using | const_iterator = const_pointer |
| using | reverse_iterator = std::reverse_iterator< iterator > |
| using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
| using | tag_type = Tag |
| using | hasher = hardened_hash<> |
| Value hashing function. More... | |
Public Member Functions | |
| pointer | data () |
| const_pointer | data () const |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| const_iterator | cbegin () const |
| const_iterator | cend () const |
| constexpr | base_uint () |
| constexpr | base_uint (beast::Zero) |
| base_uint (std::uint64_t b) | |
| constexpr | base_uint (std::string_view sv) noexcept(false) |
| template<class Container , class = std::enable_if_t< detail::is_contiguous_container<Container>::value && std::is_trivially_copyable<typename Container::value_type>::value>> | |
| base_uint (Container const &c) | |
| template<class Container > | |
| std::enable_if_t< detail::is_contiguous_container< Container >::value &&std::is_trivially_copyable< typename Container::value_type >::value, base_uint & > | operator= (Container const &c) |
| constexpr int | signum () const |
| bool | operator! () const |
| constexpr base_uint | operator~ () const |
| base_uint & | operator= (std::uint64_t uHost) |
| base_uint & | operator^= (const base_uint &b) |
| base_uint & | operator&= (const base_uint &b) |
| base_uint & | operator|= (const base_uint &b) |
| base_uint & | operator++ () |
| const base_uint | operator++ (int) |
| base_uint & | operator-- () |
| const base_uint | operator-- (int) |
| base_uint | next () const |
| base_uint | prev () const |
| base_uint & | operator+= (const base_uint &b) |
| constexpr bool | parseHex (std::string_view sv) |
| Parse a hex string into a base_uint. More... | |
| constexpr bool | parseHex (const char *str) |
| bool | parseHex (std::string const &str) |
| base_uint< Bits, Tag > & | operator= (beast::Zero) |
| bool | isZero () const |
| bool | isNonZero () const |
| void | zero () |
Static Public Member Functions | |
| static base_uint | fromVoid (void const *data) |
| template<class T > | |
| static std::optional< base_uint > | fromVoidChecked (T const &from) |
| static constexpr std::size_t | size () |
Static Public Attributes | |
| static std::size_t constexpr | bytes = Bits / 8 |
Private Types | |
| enum class | ParseResult { okay , badLength , badChar } |
Private Member Functions | |
| base_uint (void const *data, VoidHelper) | |
| constexpr Expected< decltype(data_), ParseResult > | parseFromStringView (std::string_view sv) noexcept |
| constexpr decltype(data_) | parseFromStringViewThrows (std::string_view sv) noexcept(false) |
Private Attributes | |
| std::array< std::uint32_t, WIDTH > | data_ |
Static Private Attributes | |
| static constexpr std::size_t | WIDTH = Bits / 32 |
Friends | |
| template<class Hasher > | |
| void | hash_append (Hasher &h, base_uint const &a) noexcept |
Integers of any length that is a multiple of 32-bits.
| Bits | The number of bits this integer should have; must be at least 64 and a multiple of 32. |
| Tag | An arbitrary type that functions as a tag and allows the instantiation of "distinct" types that the same number of bits. |
Definition at line 84 of file base_uint.h.
| using ripple::base_uint< Bits, Tag >::size_type = std::size_t |
Definition at line 110 of file base_uint.h.
| using ripple::base_uint< Bits, Tag >::difference_type = std::ptrdiff_t |
Definition at line 111 of file base_uint.h.
| using ripple::base_uint< Bits, Tag >::value_type = unsigned char |
Definition at line 112 of file base_uint.h.
| using ripple::base_uint< Bits, Tag >::pointer = value_type* |
Definition at line 113 of file base_uint.h.
| using ripple::base_uint< Bits, Tag >::reference = value_type& |
Definition at line 114 of file base_uint.h.
| using ripple::base_uint< Bits, Tag >::const_pointer = value_type const* |
Definition at line 115 of file base_uint.h.
| using ripple::base_uint< Bits, Tag >::const_reference = value_type const& |
Definition at line 116 of file base_uint.h.
| using ripple::base_uint< Bits, Tag >::iterator = pointer |
Definition at line 117 of file base_uint.h.
| using ripple::base_uint< Bits, Tag >::const_iterator = const_pointer |
Definition at line 118 of file base_uint.h.
| using ripple::base_uint< Bits, Tag >::reverse_iterator = std::reverse_iterator<iterator> |
Definition at line 119 of file base_uint.h.
| using ripple::base_uint< Bits, Tag >::const_reverse_iterator = std::reverse_iterator<const_iterator> |
Definition at line 120 of file base_uint.h.
| using ripple::base_uint< Bits, Tag >::tag_type = Tag |
Definition at line 121 of file base_uint.h.
| using ripple::base_uint< Bits, Tag >::hasher = hardened_hash<> |
Value hashing function.
The seed prevents crafted inputs from causing degenerate parent containers.
Definition at line 169 of file base_uint.h.
|
strongprivate |
| Enumerator | |
|---|---|
| okay | |
| badLength | |
| badChar | |
Definition at line 192 of file base_uint.h.
|
explicitprivate |
Definition at line 186 of file base_uint.h.
|
constexpr |
Definition at line 266 of file base_uint.h.
|
constexpr |
Definition at line 270 of file base_uint.h.
|
explicit |
Definition at line 274 of file base_uint.h.
|
explicitconstexprnoexcept |
Definition at line 282 of file base_uint.h.
|
explicit |
Definition at line 292 of file base_uint.h.
| pointer ripple::base_uint< Bits, Tag >::data | ( | ) |
Definition at line 124 of file base_uint.h.
| const_pointer ripple::base_uint< Bits, Tag >::data | ( | ) | const |
Definition at line 129 of file base_uint.h.
| iterator ripple::base_uint< Bits, Tag >::begin | ( | ) |
Definition at line 135 of file base_uint.h.
| iterator ripple::base_uint< Bits, Tag >::end | ( | ) |
Definition at line 140 of file base_uint.h.
| const_iterator ripple::base_uint< Bits, Tag >::begin | ( | ) | const |
Definition at line 145 of file base_uint.h.
| const_iterator ripple::base_uint< Bits, Tag >::end | ( | ) | const |
Definition at line 150 of file base_uint.h.
| const_iterator ripple::base_uint< Bits, Tag >::cbegin | ( | ) | const |
Definition at line 155 of file base_uint.h.
| const_iterator ripple::base_uint< Bits, Tag >::cend | ( | ) | const |
Definition at line 160 of file base_uint.h.
|
constexprprivatenoexcept |
Definition at line 199 of file base_uint.h.
|
constexprprivatenoexcept |
Definition at line 252 of file base_uint.h.
| std::enable_if_t< detail::is_contiguous_container< Container >::value && std::is_trivially_copyable< typename Container::value_type >::value, base_uint & > ripple::base_uint< Bits, Tag >::operator= | ( | Container const & | c | ) |
Definition at line 305 of file base_uint.h.
|
static |
Definition at line 318 of file base_uint.h.
|
static |
Definition at line 325 of file base_uint.h.
|
constexpr |
Definition at line 333 of file base_uint.h.
| bool ripple::base_uint< Bits, Tag >::operator! | ( | ) | const |
Definition at line 343 of file base_uint.h.
|
constexpr |
Definition at line 349 of file base_uint.h.
| base_uint & ripple::base_uint< Bits, Tag >::operator= | ( | std::uint64_t | uHost | ) |
Definition at line 360 of file base_uint.h.
| base_uint & ripple::base_uint< Bits, Tag >::operator^= | ( | const base_uint< Bits, Tag > & | b | ) |
Definition at line 376 of file base_uint.h.
| base_uint & ripple::base_uint< Bits, Tag >::operator&= | ( | const base_uint< Bits, Tag > & | b | ) |
Definition at line 385 of file base_uint.h.
| base_uint & ripple::base_uint< Bits, Tag >::operator|= | ( | const base_uint< Bits, Tag > & | b | ) |
Definition at line 394 of file base_uint.h.
| base_uint & ripple::base_uint< Bits, Tag >::operator++ | ( | ) |
Definition at line 403 of file base_uint.h.
| const base_uint ripple::base_uint< Bits, Tag >::operator++ | ( | int | ) |
Definition at line 418 of file base_uint.h.
| base_uint & ripple::base_uint< Bits, Tag >::operator-- | ( | ) |
Definition at line 428 of file base_uint.h.
| const base_uint ripple::base_uint< Bits, Tag >::operator-- | ( | int | ) |
Definition at line 444 of file base_uint.h.
| base_uint ripple::base_uint< Bits, Tag >::next | ( | ) | const |
Definition at line 454 of file base_uint.h.
| base_uint ripple::base_uint< Bits, Tag >::prev | ( | ) | const |
Definition at line 461 of file base_uint.h.
| base_uint & ripple::base_uint< Bits, Tag >::operator+= | ( | const base_uint< Bits, Tag > & | b | ) |
Definition at line 468 of file base_uint.h.
|
constexpr |
Parse a hex string into a base_uint.
The input must be precisely 2 * bytes hexadecimal characters long, with one exception: the value '0'.
| sv | A null-terminated string of hexadecimal characters |
Definition at line 502 of file base_uint.h.
|
constexpr |
Definition at line 513 of file base_uint.h.
| bool ripple::base_uint< Bits, Tag >::parseHex | ( | std::string const & | str | ) |
Definition at line 519 of file base_uint.h.
|
staticconstexpr |
Definition at line 525 of file base_uint.h.
| base_uint< Bits, Tag > & ripple::base_uint< Bits, Tag >::operator= | ( | beast::Zero | ) |
Definition at line 531 of file base_uint.h.
| bool ripple::base_uint< Bits, Tag >::isZero | ( | ) | const |
Definition at line 539 of file base_uint.h.
| bool ripple::base_uint< Bits, Tag >::isNonZero | ( | ) | const |
Definition at line 544 of file base_uint.h.
| void ripple::base_uint< Bits, Tag >::zero | ( | ) |
Definition at line 549 of file base_uint.h.
|
friend |
Definition at line 487 of file base_uint.h.
|
staticconstexprprivate |
Definition at line 94 of file base_uint.h.
|
private |
Definition at line 99 of file base_uint.h.
|
staticconstexpr |
Definition at line 107 of file base_uint.h.