mirror of
https://github.com/Xahau/xahaud.git
synced 2026-09-27 15:38:01 +00:00
This commit makes several changes to the base_uint class, which was originally taken from Bitcoin and has already been heavily modified by Ripple engineers. It introduces conditional widening of the internal limb type, going from 32 to 64 bits if the requested number of bits is a multiple of 64. This change alone halves iteration counts for common operations and, combined with use of add-with-carry compiler intrinsics, helps leverage modern processor resources more effectively. Other changes include: - Extracting the arithmetic operations into free helper functions which operate on the limb array directly. - Replacing the SFINAE-based is_contiguous_container trait with a byte_copy_source concept. - Rewriting the hex parsing around a consteval lookup table and a simple left-to-right loop, replacing the old shift-based nibble accumulator. - Using memmove instead of memcpy when copying to avoid UB in the unlikely case where the source and destination buffers overlap. - Eliminating a workaround in operator<=> to handle MacOS quirks. - Removing redundant parseHex overloads and introducing from_hex as a factory function. - Introducing a tagless_compare() for cross-tag comparison. - Adding noexcept, [[nodiscard]], and constexpr throughout.