Skip to main content
Version: 1.5.0

Bitwise

The bitwise operations on sequences of bytes are as follows:

// Bitwise "and"
const and: bytes = 0x0005 & 0x0106; // 0x0004
// Bitwise "or"
const or: bytes = 0x0005 | 0x0106; // 0x0107
// Bitwise "xor"
const xor: bytes = 0x0005 ^ 0x0106; // 0x0103
// Bitwise "shift left"
const shift_left: bytes = 0x06 << 8n; // 0x0600
// Bitwise "shift right"
const shift_right: bytes = 0x0006 >> 1n; // 0x0003