reversing
Reverses the byte order of a value by repeatedly dividing and reconstructing.
The step parameter MUST be a power of 2 (e.g., 2, 256, 65536).
Using a non-power-of-2 step will produce incorrect results and data corruption.
Valid steps: 2 (bits), 256 (bytes), 65536 (u16 words), etc.
Arguments
word- The value to reversesize- The number of steps to performstep- The step size for division/reconstruction (MUST be a power of 2)
Returns
(T, T)- Tuple containing the reversed value and remaining value
Panics
- If
stepis not a power of 2 (runtime check performed)
Fully qualified path: alexandria_data_structures::byte_appender::reversing
pub fn reversing<
T,
+Copy<T>,
+Zero<T>,
+TryInto<T, NonZero<T>>,
+Into<T, u128>,
+TryInto<u128, T>,
+DivRem<T>,
+Drop<T>,
+MulAssign<T, T>,
+Rem<T>,
+AddAssign<T, T>,
>(
word: T, size: u32, step: T,
) -> (T, T)