Skip to main content

Bit-Masking

Definition

Bit-masking is a computer programming operation that selectively manipulates specific bits within a binary number. This technique employs a mask value with bitwise operators like AND, OR, XOR, or NOT to set, clear, or check the status of individual bits. It is fundamental for data compression, permission management, and flag handling in low-level computing. Its efficiency stems from direct hardware manipulation.