Provides bitwise operation functions for use in HotMesh mapping rules. Although inspired by JavaScript, they have been adapted to follow a functional approach. Each transformation is a function that expects one or more input parameters from the prior row in the @pipe structure.

Invoked in mapping rules using {@bitwise.<method>} syntax.

Constructors

Methods

  • Performs a bitwise AND operation on two numbers.

    Parameters

    • a: number

      The first operand

    • b: number

      The second operand

    Returns number

    The result of a & b

    bitwise_and_result:
    "@pipe":
    - ["{a.numbers.a}", "{a.numbers.b}"]
    - ["{@bitwise.and}"]
  • Performs a bitwise left shift operation on a number.

    Parameters

    • a: number

      The number to shift

    • b: number

      The number of positions to shift left

    Returns number

    The result of a << b

    bitwise_left_shift_result:
    "@pipe":
    - ["{a.numbers.a}", "{a.numbers.shift}"]
    - ["{@bitwise.leftShift}"]
  • Performs a bitwise OR operation on two numbers.

    Parameters

    • a: number

      The first operand

    • b: number

      The second operand

    Returns number

    The result of a | b

    bitwise_or_result:
    "@pipe":
    - ["{a.numbers.a}", "{a.numbers.b}"]
    - ["{@bitwise.or}"]
  • Performs a bitwise right shift operation on a number, preserving the sign bit.

    Parameters

    • a: number

      The number to shift

    • b: number

      The number of positions to shift right

    Returns number

    The result of a >> b

    bitwise_right_shift_result:
    "@pipe":
    - ["{a.numbers.a}", "{a.numbers.shift}"]
    - ["{@bitwise.rightShift}"]
  • Performs a bitwise unsigned right shift operation on a number.

    Parameters

    • a: number

      The number to shift

    • b: number

      The number of positions to shift right

    Returns number

    The result of a >>> b

    bitwise_unsigned_right_shift_result:
    "@pipe":
    - ["{a.numbers.a}", "{a.numbers.shift}"]
    - ["{@bitwise.unsignedRightShift}"]
  • Performs a bitwise XOR operation on two numbers.

    Parameters

    • a: number

      The first operand

    • b: number

      The second operand

    Returns number

    The result of a ^ b

    bitwise_xor_result:
    "@pipe":
    - ["{a.numbers.a}", "{a.numbers.b}"]
    - ["{@bitwise.xor}"]