擅长:python、mysql、java
<blockquote>
<p>2 higher bytes mean the major version, 2 lower bytes mean the minor version, e.g. 0x00030000 means version 3.0.</p>
</blockquote>
<p>正如您在示例中看到的,数字是十六进制格式(0x前缀)。在十六进制格式中,您可以很容易地看到字节-2个十六进制数字=1个字节(因为16*16是256)。在</p>
<p>您需要使用<code>hex(your_value_here)</code>将您的数字转换为十六进制,并将其分为两部分用于主要版本和次要版本。在</p>
<p>在您的例子中,<code>hex(393216)</code>返回<code>'0x60000'</code>-也就是说,<code>0x0</code>作为2个较低的字节(次要版本),而{<cd5>}作为更高的字节(主要版本),给出版本6.0</p>
<p>编辑:</p>
<p>还可以使用二进制操作提取版本。使用<code>your_number_here>>16</code>将数字16位(2个字节)右移,即删除下面的2。在</p>
<p>所以<code>your_number>>16</code>代表大调,<code>your_number - (your_number>>16<<16)</code>代表小调。在</p>