from_bitwise

Function from_bitwise 

Source
pub const fn from_bitwise(value: u64) -> (u32, u32)
Expand description

Converts a 64-bit value into a pair of 32-bit values using bitwise operations.

This function takes a 64-bit unsigned integer value and extracts two 32-bit unsigned integers from it using bitwise operations. The lower 32 bits of the input value are extracted as the first 32-bit value, and the upper 32 bits are extracted as the second 32-bit value.

§Arguments

  • value - The 64-bit value from which to extract the 32-bit values.

§Returns

A tuple containing two 32-bit unsigned integers. The first element of the tuple is the lower 32 bits of the input value, and the second element is the upper 32 bits of the input value.

§Examples

use plugy_core::bitwise::from_bitwise;
let value: u64 = 0x0000_1234_5678_9ABC;
let (lower, upper) = from_bitwise(value);
assert_eq!(lower, 0x5678_9ABC);
assert_eq!(upper, 0x0000_1234);