Little Endian(小端字节序)

什么是 Little Endian?

Little Endian(小端字节序)是一种数据在内存中存储的方式。 在这种模式下,最低有效字节(Least Significant Byte, LSB) 存储在内存的最低地址处,而最高有效字节(MSB)则存储在高地址处。

例如,一个 32 位整数 0x12345678 在 Little Endian 系统中的内存布局如下:

地址:  0x1000  0x1001  0x1002  0x1003
值:    0x78    0x56    0x34    0x12

与 Big Endian 的对比

相对地,Big Endian(大端字节序)将最高有效字节存放在最低地址。 同样的数值 0x12345678 在 Big Endian 中的布局为:

地址:  0x1000  0x1001  0x1002  0x1003
值:    0x12    0x34    0x56    0x78

常见应用场景

检测当前系统字节序(JavaScript 示例)

你可以使用以下 JavaScript 代码检测浏览器所在系统的字节序:

function isLittleEndian() {
  const buffer = new ArrayBuffer(2);
  const view = new DataView(buffer);
  view.setInt16(0, 0x1234, true); // 强制小端写入
  return new Uint8Array(buffer)[0] === 0x34;
}

console.log('当前系统是 Little Endian:', isLittleEndian());

It Was Taken for Granted That – Reflections on Assumption and Entitlement Shared in Her Delight At – A Moment of Joy A Give and Take:给予与接受的平衡之道 积极思考,感受美好 - 培养正向心态的简单指南 熬夜的危害与应对建议 | Stay Up Late Doing Christian档次 - 探索信仰与生活的朴素之道 上学须知 | Attend to School Raindrops 歌词 - 经典英文歌曲歌词欣赏 “Had an Accident” 翻译与解释 - 中文含义及用法 Into the Breath - 探索呼吸的深度与宁静 Raindrop 是谁?——简洁介绍 Raindrop 身份与背景 Breath In - 专注呼吸,回归平静 attend to doing sth 用法详解 | 英语语法专题 Pay Attention To 什么:关注真正重要的事 “Pack up things”造句示例与用法详解 Take It for Granted That — 理所当然之事的反思 raindrop什么意思?英文单词“raindrop”中文释义与用法详解 It's Done That 句型详解 - 英语语法专题 Instant一就 - 即刻行动,一步到位 浪费时间在做某事 | 探讨拖延与低效行为 In Weather – Simple Guide to Understanding Weather Conditions “It is said that”句型转换详解 | 英语语法专题 Raining Hardly – A Quiet Reflection on Gentle Rain Hans Christian - 丹麦童话作家安徒生专题 "I take that as a given" 翻译与解析 - 英语习语学习 伦敦唐人街 - 探索英国华人文化中心 Draws No Attention - 朴素而专注的网页 批判性思维技能:提升思考与决策能力 Christian Dior - 法国奢侈时尚品牌 Eve Dies Heartbroken 翻译 - 中文含义与解析 It Was Raining Really Hard – A Moment in the Storm 批判性思维(Critical Thinking)详解 - 培养理性思考能力 Pack Up His Things - 整理与告别的温柔时刻 Be Drawn Into – Explore Curiosity and Connection When the Weather Is Fair and... – Simple Reflections on Good Days The Clock Is on the Table – A Simple Observation If Weather Permitted – A Reflection on Plans and Possibilities Destination - 探索你的理想目的地 Raindrops 歌曲介绍 - 经典旋律与歌词赏析 thinking 的音标 - 英式与美式发音对照 Kiss The Rain 钢琴谱 - 简易版免费下载 Rain Hard - 暴雨倾盆的自然现象与思考 Walking Down the Street - 漫步街头的宁静与思考 Run Up With - 简约跑步伙伴 During the Two Days - 简朴回忆录 Pay Attention to Doing - 专注当下,高效行动 And His Friends – A Simple Story of Friendship Check-in Baggage Guide | What You Need to Know Raindrop衣服 - 简约自然的雨滴灵感服饰 In the Run Up – Understanding the Phrase and Its Uses Might Not Have Been Initialized - 常见编程错误解析 Due Attention Should Be Paid To – A Thoughtful Reflection Hard Things:直面困难,成就成长 Weather Conditions - Understand Today's Weather ItIsHard 后接:探索编程与技术中的挑战 Critical Thinking: Definition and Overview attend组词 - 常见搭配与例句 stay up to do 和 doing 的区别详解 | 英语语法小知识 The Dawn 原版 - 经典模组介绍 Be Partnered With – Build Meaningful Collaborations Accident 的常见搭配用法 | 英语学习资源 They Have Had an Accident – Support and Information Kiss The Rain 钢琴谱简易版 - 免费下载与在线查看 bepacked with - 含义、用法与例句详解 Kiss The Rain 简谱数字版 | 钢琴曲数字简谱 An Accident Happened – Incident Report and Safety Awareness Be Packed In – Understanding Crowded Spaces and Urban Density Power Packed Into – Simple & Efficient Solutions He Has the Reputation of Being – A Reflection on Character and Perception Take Something for Granted:别把一切视为理所当然 什么onthemachine - 探索机器背后的真相 Run Up the Road – 奔跑在路上的旅程 中国男子篮球职业联赛(CBA)官方网站 | CBA联赛介绍与资讯 But We Were Surprised That Ninety Percent – A Reflection Raindrop Counting(雨滴计数)中文介绍 spend time doing sth 句子结构详解 | 英语语法学习 Standup 起立:站立办公与健康生活指南 Heartbreaking 翻译中文 - 心碎的含义与用法详解 accidentally 音标 - 英文单词发音与释义 spendwith 的用法详解 - 英语语法学习 Several Recent Studies Have: Insights from the Latest Research How a Poor Abandoned Parisian Survives: Stories from the Streets of Paris accidental的用法详解 | 英语词汇学习 如何有意义地投入时间 | Spend Time in Something It Is Unfair That Historians – A Reflection on Historical Bias 探索目的地 | 精选全球旅行地推荐 Accidentally vs Accidently: Correct Spelling Guide in the end 与 at the end 的区别 | 英语语法解析 The Power of Positive Thinking | Harness Optimism for a Better Life Attend to Do Something - English Grammar Guide Chinatown Market - Explore Authentic Asian Goods packupthings 翻译 - 中文含义与使用指南 Spend Time on Doing Something – Learn English Grammar This Is His Head - 简洁专题页面 Qantas Check In - Online Check-In for Qantas Flights Critical Thinking 原文及翻译 | 批判性思维学习资料 说易行难 - To Say Is Easier Than To Do 王心凌《The Day Went Away》歌曲介绍 《The Rain》五线谱 - 免费下载与欣赏 Accidental造句示例大全 - 英语学习资源