Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

u256_from_u32_array

Converts an array of 8 u32 values into a single u256 value.

This function treats the input array as a sequence of 32-bit words, where the first element of the array represents the most significant 32 bits and the last element represents the least significant 32 bits. The resulting u256 value is constructed by combining these words in big-endian order.

Arguments

  • arr - An array of 8 u32 values to be converted into a u256.

Returns

  • A u256 value representing the combined value of the input array.

Example

let arr: [u32; 8] = [0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8];
let result: u256 = u256_from_u32_array(arr);
// `result` will now hold the value:
// 0x00000001_00000002_00000003_00000004_00000005_00000006_00000007_00000008

Fully qualified path: starkware_utils::math::utils::u256_from_u32_array

pub fn u256_from_u32_array(arr: [u32; 8]) -> u256