Skip to main content

apply_bitwise_not_with_width

Function apply_bitwise_not_with_width 

Source
pub fn apply_bitwise_not_with_width(
    left: &Value,
    right: &Value,
    bit_width: Option<u32>,
) -> bool
Expand description

Apply bitwise NOT with type-aware bit-width masking

When bit_width is provided, the complement is masked to the type’s natural width. For example, a ubyte (8-bit) NOT of 0x00 yields 0xFF, not u64::MAX. Without a bit width, the full 64-bit complement is used.

§Arguments

  • left - The left-hand side value (typically from file data)
  • right - The right-hand side value to compare !left against
  • bit_width - Optional bit width for masking (8, 16, 32, or 64)

§Returns

true if the width-masked complement of left equals right