V2EX  ›  英汉词典

Bitmask

Definition / 定义

bitmask(位掩码/比特掩码):在计算机中用一串二进制位(0/1)作为“掩码”,通过按位运算(如 AND、OR、XOR)来选择、屏蔽或提取某些位,常用于标志位(flags)、权限、状态字段等。

Pronunciation / 发音

/ˈbɪtˌmæsk/

Examples / 例句

Use a bitmask to enable debug logging.
用位掩码来启用调试日志。

In this protocol, the header stores multiple options in one integer, and we decode them with a bitmask and bitwise AND.
在这个协议里,头部用一个整数存放多个选项,我们用位掩码配合按位与来解码它们。

Etymology / 词源

bit(比特,二进制位)+ mask(面具/遮罩/掩码)构成:意思是“用来遮住或筛选某些比特位的遮罩”。在底层编程与硬件相关语境中非常常见。

Related Words / 相关词

Literary Works / 文学作品

  • The C Programming Language(Kernighan & Ritchie):在位运算与“bit mask/bitmask”相关示例中常出现
  • Computer Systems: A Programmer’s Perspective:讲解位级表示与按位操作时会用到 bitmask 概念
  • Linux Kernel Development:涉及内核标志位与位操作时常见 bitmask 用法
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   835 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 23:48 · PVG 07:48 · LAX 15:48 · JFK 18:48
♥ Do have faith in what you're doing.