🔁 格雷码转十六进制Gray Code to Hexadecimal Converter
把格雷码(二进制位串)还原并转换成十六进制数,每行一个,可同时显示十进制值。Decode Gray code bit strings and convert them to hexadecimal, one per line, with optional decimal values.
使用说明与常见问题How-to & FAQ
「格雷码转十六进制」是什么?What is the Gray Code to Hexadecimal Converter tool?
把格雷码(二进制位串)还原并转换成十六进制数,每行一个,可同时显示十进制值。Decode Gray code bit strings and convert them to hexadecimal, one per line, with optional decimal values.
如何使用「格雷码转十六进制」?How do I use the Gray Code to Hexadecimal Converter tool?
在「格雷码转十六进制」中,把内容粘贴或输入到上方输入框,结果会实时显示在下方,点击「复制结果」即可复制。例如输入「10000000」,得到「FF」。In the Gray Code to Hexadecimal Converter: Paste or type into the input box; the result appears below instantly — click "Copy result" to copy it. Example: "10000000" → "FF".
格雷码怎么算?How is Gray code computed?
把数值 n 转成格雷码:G = n XOR (n >> 1),即最高位不变,其余每位是二进制中该位与左边一位的异或。格雷码还原:从最高位开始逐位累积异或。相邻两个数的格雷码只有一位不同。To get the Gray code of a value n: G = n XOR (n >> 1) — the top bit stays and each other bit is the XOR of that binary bit and the one to its left. To decode, XOR the bits cumulatively from the top. Neighbouring values differ in exactly one bit.
能处理多长的数?How long can the numbers be?
每行一个数,用 BigInt 精确计算,长度不受 2^53 限制。空格和下划线被当作分组符号忽略,输入可加 0b 前缀;0x、0o 不接受。One number per line, computed exactly with BigInt, so there is no 2^53 limit. Spaces and underscores are ignored as grouping, and the input may start with 0b; 0x and 0o are not accepted.
代码或数据会被上传吗?Is my code or data uploaded?
不会。「格雷码转十六进制」完全用 JavaScript 在本地运行,适合处理含有密钥、内部接口等敏感内容的数据。No. The Gray Code to Hexadecimal Converter runs entirely in local JavaScript, so it is safe for data containing keys or internal endpoints.
「格雷码转十六进制」免费吗?需要注册吗?Is the Gray Code to Hexadecimal Converter free? Do I need an account?
「格雷码转十六进制」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Gray Code to Hexadecimal Converter is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.