我有一个包含两个值的字节数组:07
和 DE
(十六进制)。
我的需求是将这两个值连接起来,得到十六进制值07DE
,并从该十六进制值中获取十进制值。在这种情况下,它是2014
。
我的代码:
# This line gives 11 bytes worth of information
[Byte[]] $hexbyte2 = $obj.OIDValueB
# All I need are the first two bytes (the values in this case are 07 and DE in HEX)
[Byte[]] $year = $hexbyte2[0], $hexbyte2[1]
我该如何将它们组合起来以形成
07DE
并将其转换为整数以获得2014
?