Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

one_shift_left_bytes_felt252

Computes 256^n_bytes for felt252 byte shifting operations

This function calculates the value needed to shift bytes within a felt252 value. Since felt252 can hold up to 31 bytes, this function handles the full range by splitting calculations between the low and high 128-bit parts when necessary.

Arguments

  • n_bytes - The number of byte positions to shift (0-30)

Returns

  • felt252 - The value 256^n_bytes for byte shifting operations

Fully qualified path: alexandria_bytes::bit_array::one_shift_left_bytes_felt252

pub fn one_shift_left_bytes_felt252(n_bytes: u32) -> felt252