V2EX  ›  英汉词典

Host-byte-order

定义 Definition

host byte order(主机字节序):指一台计算机在内存中存储多字节数据(如 16/32/64 位整数)时采用的字节排列顺序,通常为小端(little-endian)大端(big-endian)。在网络编程中常与 network byte order(网络字节序,通常为大端)对比,用于说明是否需要做字节序转换。

发音 Pronunciation (IPA)

/hoʊst baɪt ˈɔːrdər/

例句 Examples

The integer is stored in host byte order.
这个整数以主机字节序存储。

Before sending the packet, convert the 32-bit value from host byte order to network byte order using htonl().
在发送数据包之前,用 htonl() 把 32 位数值从主机字节序转换为网络字节序。

词源 Etymology

该短语由 host(主机) + byte(字节) + order(顺序)构成,源自计算机网络与系统编程语境:不同硬件架构可能采用不同的字节排列方式,因此在跨平台通信(尤其是 TCP/IP)中需要明确“主机自己的字节序”,并通过标准函数进行转换以保证互操作性。

相关词 Related Words

文学与著作 Literary Works

  • UNIX Network Programming(W. Richard Stevens)
  • TCP/IP Illustrated, Volume 1(W. Richard Stevens)
  • Beej’s Guide to Network Programming(网络编程入门指南)
  • POSIX / BSD sockets 相关手册页(如 htonl(3), ntohl(3) 等)
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   857 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 10ms · UTC 23:43 · PVG 07:43 · LAX 15:43 · JFK 18:43
♥ Do have faith in what you're doing.